-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: add memory-spike plugin #33
base: main
Are you sure you want to change the base?
Conversation
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.
Instead of creating a function inside globalThis, I'd add all the context into the beforeClockTemplate
. Also, I wouldn't perform memory translations during the collect process, instead, you can do it textReporter. Just check if bench.plugins includes this new plugin.
#spikeSamples = {}; | ||
isSupported() { | ||
try { | ||
new Function(`gc()`); |
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.
new Function(`gc()`); | |
new Function(`gc()`)(); |
I think you should call the function to it to throw, right?
getReport() { | ||
process._rawDebug('grp',arguments); | ||
|
||
} |
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.
This shouldn't be here, right?
|
||
### Class: `RecordMemorySpikePlugin` | ||
|
||
A plugin to record memory allocation spikes in your benchmark's run. It should help you understand the speed vs memory tradeoffs you're making. |
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.
We should mention folks that are going to use it will need to pass --expose-gc
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.
I'd also mention a possible performance inconsistency when this plugin is enabled due to GC blocking op.
it took going on holiday again, but here it is
open questions:
__recordMemorySpike
going to cause trouble in workers?