mirror of
https://github.com/nodejs/node.git
synced 2025-12-27 23:41:14 +00:00
benchmark: use boolean options in benchmark tests
Some checks failed
Test and upload documentation to artifacts / build-docs (push) Has been cancelled
Linters / lint-addon-docs (push) Has been cancelled
Linters / lint-cpp (push) Has been cancelled
Linters / format-cpp (push) Has been cancelled
Linters / lint-js-and-md (push) Has been cancelled
Linters / lint-nix (push) Has been cancelled
Linters / lint-py (push) Has been cancelled
Linters / lint-yaml (push) Has been cancelled
Linters / lint-sh (push) Has been cancelled
Linters / lint-codeowners (push) Has been cancelled
Linters / lint-pr-url (push) Has been cancelled
Linters / lint-readme (push) Has been cancelled
Notify on Push / Notify on Force Push on `main` (push) Has been cancelled
Notify on Push / Notify on Push on `main` with invalid message (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
Some checks failed
Test and upload documentation to artifacts / build-docs (push) Has been cancelled
Linters / lint-addon-docs (push) Has been cancelled
Linters / lint-cpp (push) Has been cancelled
Linters / format-cpp (push) Has been cancelled
Linters / lint-js-and-md (push) Has been cancelled
Linters / lint-nix (push) Has been cancelled
Linters / lint-py (push) Has been cancelled
Linters / lint-yaml (push) Has been cancelled
Linters / lint-sh (push) Has been cancelled
Linters / lint-codeowners (push) Has been cancelled
Linters / lint-pr-url (push) Has been cancelled
Linters / lint-readme (push) Has been cancelled
Notify on Push / Notify on Force Push on `main` (push) Has been cancelled
Notify on Push / Notify on Push on `main` with invalid message (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
Use boolean values for randomUUID benchmark and deprecate benchmark instead of 0/1. PR-URL: https://github.com/nodejs/node/pull/60129 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
This commit is contained in:
parent
7b7004a0ed
commit
42d0e1307b
@ -5,11 +5,10 @@ const { randomUUID } = require('crypto');
|
||||
|
||||
const bench = common.createBenchmark(main, {
|
||||
n: [1e7],
|
||||
disableEntropyCache: [0, 1],
|
||||
disableEntropyCache: [false, true],
|
||||
});
|
||||
|
||||
function main({ n, disableEntropyCache }) {
|
||||
disableEntropyCache = !!disableEntropyCache;
|
||||
bench.start();
|
||||
for (let i = 0; i < n; ++i)
|
||||
randomUUID({ disableEntropyCache });
|
||||
|
||||
@ -5,7 +5,7 @@ const assert = require('assert');
|
||||
|
||||
const bench = common.createBenchmark(main, {
|
||||
n: [1e5],
|
||||
modifyPrototype: [1, 0],
|
||||
modifyPrototype: [true, false],
|
||||
emitWarningSync: [1, 0],
|
||||
}, {
|
||||
flags: ['--expose-internals'],
|
||||
@ -23,7 +23,7 @@ function main({ n, modifyPrototype, emitWarningSync }) {
|
||||
'This function is deprecated',
|
||||
'DEP0000',
|
||||
emitWarningSync,
|
||||
!!modifyPrototype,
|
||||
modifyPrototype,
|
||||
);
|
||||
|
||||
let sum = 0;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user