Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: reduce benchmark runs in tests #21032

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions benchmark/crypto/aes-gcm-throughput.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const bench = common.createBenchmark(main, {
});

function main({ n, len, cipher }) {
// Default cipher for tests.
if (cipher === '')
cipher = 'aes-128-gcm';
const message = Buffer.alloc(len, 'b');
const key = crypto.randomBytes(keylen[cipher]);
const iv = crypto.randomBytes(12);
Expand Down
3 changes: 3 additions & 0 deletions benchmark/crypto/cipher-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ const bench = common.createBenchmark(main, {
});

function main({ api, cipher, type, len, writes }) {
// Default cipher for tests.
if (cipher === '')
cipher = 'AES192';
if (api === 'stream' && /^v0\.[0-8]\./.test(process.version)) {
console.error('Crypto streams not available until v0.10');
// use the legacy, just so that we can compare them.
Expand Down
5 changes: 3 additions & 2 deletions test/parallel/test-benchmark-crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ const runBenchmark = require('../common/benchmark');

runBenchmark('crypto',
[
'n=1',
'algo=sha256',
'api=stream',
'cipher=',
'keylen=1024',
'len=1',
'n=1',
'out=buffer',
'type=buf',
'v=crypto',
'writes=1'
'writes=1',
],
{ NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
3 changes: 2 additions & 1 deletion test/parallel/test-benchmark-timers.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const runBenchmark = require('../common/benchmark');

runBenchmark('timers',
[
'direction=start',
'n=1',
'type=depth',
'n=1'
],
{ NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });