perf_hooks: add binary export/import to Histogram - #65434
Conversation
|
Review requested:
|
00936d8 to
fbcb489
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #65434 +/- ##
==========================================
+ Coverage 90.11% 90.13% +0.02%
==========================================
Files 752 752
Lines 252208 253257 +1049
Branches 47447 47641 +194
==========================================
+ Hits 227274 228278 +1004
+ Misses 16219 16215 -4
- Partials 8715 8764 +49
🚀 New features to boost your workflow:
|
fbcb489 to
5d9f7ce
Compare
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
5d9f7ce to
dfaacaf
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 gives Histogram a new binary interchange format |
dfaacaf to
28eb138
Compare
require('node:perf_hooks').importHistogram(new Uint8Array([
0xa3, // map(3)
0x01, 0x1b, 0,0,0x20,0,0,0,0,0, // 1 (lowest) = 2**45
0x02, 0x1b, 0,0,0x40,0,0,0,0,0, // 2 (highest) = 2**46
0x03, 0x05, // 3 (figures) = 5
]));This still bypasses the checks and triggers assert on |
|
Ugh. yeah, will have to make the validation more thorough.. will update shortly |
28eb138 to
9b57e4f
Compare
Provide a binary export/import mechanism for histograms. Since there is no standard interchange format for histograms, using CBOR is meant to make the format as platform/runtime agnostic as possible while producing a compact/efficient result. No new dependency is introduced, we just encode the CBOR directly. Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode/Opus
Signed-off-by: James M Snell <jasnell@gmail.com>
9b57e4f to
af64f27
Compare
Stacks on: #65416
Pay attention only to the last two commits.