-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor benchmark script #6376
Conversation
|
This comment was marked as outdated.
This comment was marked as outdated.
Looks like I need to fork this to properly test the workflow. Now it's using the main workflow. |
This comment was marked as outdated.
This comment was marked as outdated.
Yep that's correct. I use a personal fork for testing actions/CI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Excited for this.
*/ | ||
export class AstroTimer { | ||
private enabled: boolean; | ||
private ongoingTimers: Map<string, OngoingStat> = new Map(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could use WeakMap
? It doesn't seem we iterate them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weak maps only allows objects as keys, we also need to refetch the OngoingStat
when calling the end()
method, so we need it to persists indefinitely as there isn't a reference to pass around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a heads up that Docs usually removes the review request to Astro Docs Maintainers ourselves! (We get pinged, so we do monitor these requests.)
We are automatically pinged whenever a README file is included in a PR because this is content that someone might... read! And even if internal, we do care about its quality.
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Going to merge this to unblock the memory optimizations soon. Happy to improve further if there's more changes to add. Thanks for the reviews! |
Changes
Update root
pnpm benchmark
script and CI!bench
command. See https://github.com/bluwy/astro/pull/2 for examples, e.g. https://github.com/bluwy/astro/pull/2#issuecomment-1448419909Also added a new
/benchmark
folder with READMEs within it that should hopefully help clarify how it works.The Astro codebase is also tweaked a bit to collect timing/memory logs via
process.env.ASTRO_TIMER_PATH
, and if it exists collect and write the results to the path. This makes passing the results easier between child processes. It's only used for benchmarking.Locally, you can run
pnpm benchmark
,pnpm benchmark memory
,pnpm benchmark server-stress
, etcIn PR comments, you can comment
!bench
,!bench memory
,!bench server-stress
, etcTesting
Manual testing
Docs
n/a. This doesn't touch on user documentation