diff options
author | James M Snell <jasnell@gmail.com> | 2021-01-28 16:34:27 -0800 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2021-02-22 08:46:11 -0800 |
commit | f3eb224c83f96cff9231f17b1c0a36b762942f48 (patch) | |
tree | 42b62cc1122ef355a47cfe49780a34465887810b /test/parallel/test-performance-measure.js | |
parent | 9f2efaa6f3878509a053a5aa9dab7b1b96d2add3 (diff) | |
download | node-new-f3eb224c83f96cff9231f17b1c0a36b762942f48.tar.gz |
perf_hooks: complete overhaul of the implementation
* Update the user timing implementation to conform to
User Timing Level 3.
* Reimplement user timing and timerify with pure JavaScript
implementations
* Simplify the C++ implementation for gc and http2 perf
* Runtime deprecate additional perf entry properties
in favor of the standard detail argument
* Disable the `buffered` option on PerformanceObserver,
all entries are queued and dispatched on setImmediate.
Only entries with active observers are buffered.
* This does remove the user timing and timerify
trace events. Because the trace_events are still
considered experimental, those can be removed without
a deprecation cycle. They are removed to improve
performance and reduce complexity.
Old: `perf_hooks/usertiming.js n=100000: 92,378.01249733355`
New: perf_hooks/usertiming.js n=100000: 270,393.5280638482`
PR-URL: https://github.com/nodejs/node/pull/37136
Refs: https://github.com/nodejs/diagnostics/issues/464
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Diffstat (limited to 'test/parallel/test-performance-measure.js')
-rw-r--r-- | test/parallel/test-performance-measure.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/parallel/test-performance-measure.js b/test/parallel/test-performance-measure.js index 06e04cc219..e9aaca72bd 100644 --- a/test/parallel/test-performance-measure.js +++ b/test/parallel/test-performance-measure.js @@ -8,11 +8,11 @@ const DELAY = 1000; const expected = ['Start to Now', 'A to Now', 'A to B']; const obs = new PerformanceObserver(common.mustCall((items) => { - const entries = items.getEntries(); - const { name, duration } = entries[0]; - assert.ok(duration > DELAY); - assert.strictEqual(expected.shift(), name); -}, 3)); + items.getEntries().forEach(({ name, duration }) => { + assert.ok(duration > DELAY); + assert.strictEqual(expected.shift(), name); + }); +})); obs.observe({ entryTypes: ['measure'] }); performance.mark('A'); |