benchmark: add --analyze mode to compare.js · nodejs/node@74234ee · GitHub
Skip to content

Commit 74234ee

Browse files
jasnelladuh95
authored andcommitted
benchmark: add --analyze mode to compare.js
Add an --analyze flag that performs statistical analysis directly after benchmarks complete, eliminating the need for R and compare.R. When --analyze is specified, compare.js collects the rate data during the run and prints a statistical summary table instead of CSV output. The table matches the format of compare.R: improvement percentage, significance stars (* p<0.05, ** p<0.01, *** p<0.001), and confidence intervals at three risk levels. Also adds a --max-regression N option that causes the compare.js to exit with 1 (error) when the `--new` is N% slower. Useful for CI use to detect regressions. Uses the histogram API's welchTest() and cohensD() methods introduced in the previous commit. Benchmark rates are scaled to integers for HdrHistogram recording; the --scale option (default 1000) controls the multiplier for precision. Usage: node benchmark/compare.js --old ./node-old --new ./node-new \ --analyze url Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode/Opus PR-URL: #65416 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent 9e8e908 commit 74234ee

3 files changed

Lines changed: 288 additions & 26 deletions

File tree

benchmark/_benchmark_progress.js

Lines changed: 6 additions & 2 deletions

benchmark/compare.js

Lines changed: 230 additions & 9 deletions

0 commit comments

Comments
 (0)