mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
1d35a066e7
Adds a debug-only macro that can be used to track when a V8 fast API is called. A map of counters is maintained in in thread-local storage and an internal API can be called to get the total count associated with a call id. Specific tests are added and `crypto.timingSafeEqual` as well as internal documentation are updated to show how to use the macro and test fast API calls without running long loops. PR-URL: https://github.com/nodejs/node/pull/54317 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
19 lines
436 B
JavaScript
19 lines
436 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
if (common.isWindows) {
|
|
common.skip('vcbuild.bat doesn\'t build the n-api benchmarks yet');
|
|
}
|
|
|
|
if (!common.isMainThread) {
|
|
common.skip('addons are not supported in workers');
|
|
}
|
|
|
|
if (common.isDebug) {
|
|
common.skip('benchmark does not work with debug build yet');
|
|
}
|
|
const runBenchmark = require('../common/benchmark');
|
|
|
|
runBenchmark('napi', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
|