perf_hooks: add statistical hypothesis testing to histogram - #65416
perf_hooks: add statistical hypothesis testing to histogram#65416jasnell wants to merge 2 commits into
Conversation
|
Review requested:
|
f866877 to
bc4d71e
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #65416 +/- ##
========================================
Coverage 90.11% 90.11%
========================================
Files 752 752
Lines 252208 252898 +690
Branches 47447 47559 +112
========================================
+ Hits 227274 227911 +637
- Misses 16219 16261 +42
- Partials 8715 8726 +11
🚀 New features to boost your workflow:
|
This comment was marked as outdated.
This comment was marked as outdated.
bc4d71e to
54c4c56
Compare
This comment was marked as outdated.
This comment was marked as outdated.
|
/cc @nodejs/performance |
Welch's t-test, Mann-Whitney U test, Cohen's d, and Cliff's delta, and and handful of others These methods enable in-process benchmark comparison and regression detection without external dependencies. No new dependencies. Tests and docs created by the AI agent. Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode/Opus
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
54c4c56 to
0793579
Compare
|
The
notable-change
Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. Otherwise, the commit will be placed in the Other Notable Changes section. |
|
Notes for the notable change: This PR expands the analytical capabilities of |
Continue expanding the capabilities of the
HistogramAPI... and use it to enable a dependency-freebenchmark/compare.jsoption... i.e. no longer requiring R-script to show benchmark analysis... just runbenchmark/compare.jswith the--analyzeoption.The added algorithms cover analysis calculations that would be fairly common in perf analysis (latency, burn rates, detecting regressions, etc). Prior to this, really the only way to get these were to use aging outside dependencies (5+ years old) or R-script.
Just scratching an old itch I've been wanting since I added
Histogramback in v11. I've been doing a bunch of benchmarking lately with the QUIC and DTLS impls and just got tired of having to use outside deps for this stuff./cc @mcollina