-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
benchmark: add calibrate-n script #59186
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
base: main
Are you sure you want to change the base?
Conversation
This script should help identify the best N when creating/updating benchmarks Signed-off-by: RafaelGSS <[email protected]>
Review requested:
|
According to nodejs#59186 this benchmark file takes 6 hours to complete a full benchmark/compare.js script (60 runs in total) and this regression tests unrealitics to do between Node.js releases. By using calibrate-n scripts I could find a better N also ajusting some bench configs. e.g: avoid dead code elimination by V8.
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.
Awesome tool
I was thinking about this, it will be a good sanity check to get an old PR with perf improvements with the benchmark percentages and then checkout and run this tool to change the parameters to see what we will have in terms of percentages of improvements with the new parameters. |
That only works if:
So, it's a bit impractical. This tool was created as an attempt to find the good N as most benchmarks is using a N too big. So, in theory, it won't change much. |
According to #59186 this benchmark file takes 6 hours to complete a full benchmark/compare.js script (60 runs in total) and this regression tests unrealitics to do between Node.js releases. By using calibrate-n scripts I could find a better N also ajusting some bench configs. e.g: avoid dead code elimination by V8. PR-URL: #59187 Refs: #59186 Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
According to #59186 this benchmark file takes 6 hours to complete a full benchmark/compare.js script (60 runs in total) and this regression tests unrealitics to do between Node.js releases. By using calibrate-n scripts I could find a better N also ajusting some bench configs. e.g: avoid dead code elimination by V8. PR-URL: #59187 Refs: #59186 Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
benchmark: add calibrate-n script
It's not new that our benchmark suite takes a huge amount to conclude. I have experienced that myself while writing the State of Node.js Performance 2023 and 2024.
With the help of #59174, I have measured how long it takes to conclude (of course, on my personal machine). This resulted in
Full source in: https://docs.google.com/spreadsheets/d/17iZuGR57r7ap4hFG8Tdz5Q-A7oV0cwM4MQW4q5bHA0U/edit?usp=sharing.
The problem is that some benchmarks contain a lot of configurations and an arbitrary N(the number of iterations we run between
bench.start()
andbench.end(n)
). That said, I wrote acalibrate-n.js
scripts that measure an "ideal" N for each benchmark file, taking into consideration the following constraints:This should help benchmark files to find the lowest N with the lowest variance and thus reduce all benchmark suite time. I'll be opening some PRs during the week, changing the N of some benchmarks.