Skip to content

Commit aa0a01b

Browse files
committed
Revert "test: refactor all benchmark tests to use the new test option"
This reverts commit 78aa348. Refs: #31396 PR-URL: #31722 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Vladimir de Turckheim <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 7cfbc9f commit aa0a01b

32 files changed

+322
-34
lines changed

test/benchmark/test-benchmark-assert.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,15 @@ require('../common');
77

88
const runBenchmark = require('../common/benchmark');
99

10-
runBenchmark('assert');
10+
runBenchmark(
11+
'assert',
12+
[
13+
'strict=1',
14+
'len=1',
15+
'method=',
16+
'n=1',
17+
'primitive=null',
18+
'size=1',
19+
'type=Int8Array'
20+
]
21+
);

test/benchmark/test-benchmark-async-hooks.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,11 @@ if (!common.enoughTestMem)
1010

1111
const runBenchmark = require('../common/benchmark');
1212

13-
runBenchmark('async_hooks');
13+
runBenchmark('async_hooks',
14+
[
15+
'asyncHooks=all',
16+
'connections=50',
17+
'method=trackingDisabled',
18+
'n=10'
19+
],
20+
{});

test/benchmark/test-benchmark-buffer.js

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,30 @@ require('../common');
44

55
const runBenchmark = require('../common/benchmark');
66

7-
runBenchmark('buffers', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
7+
runBenchmark('buffers',
8+
[
9+
'aligned=true',
10+
'args=1',
11+
'buffer=fast',
12+
'bytes=0',
13+
'byteLength=1',
14+
'charsPerLine=6',
15+
'difflen=false',
16+
'encoding=utf8',
17+
'endian=BE',
18+
'extraSize=1',
19+
'len=256',
20+
'linesCount=1',
21+
'method=',
22+
'n=1',
23+
'partial=true',
24+
'pieces=1',
25+
'pieceSize=1',
26+
'search=@',
27+
'size=1',
28+
'source=array',
29+
'type=',
30+
'value=0',
31+
'withTotalLength=0'
32+
],
33+
{ NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });

test/benchmark/test-benchmark-child-process.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,12 @@ require('../common');
44

55
const runBenchmark = require('../common/benchmark');
66

7-
runBenchmark('child_process', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
7+
runBenchmark('child_process',
8+
[
9+
'dur=0',
10+
'n=1',
11+
'len=1',
12+
'params=1',
13+
'methodName=execSync',
14+
],
15+
{ NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });

test/benchmark/test-benchmark-cluster.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,9 @@ require('../common');
44

55
const runBenchmark = require('../common/benchmark');
66

7-
runBenchmark('cluster');
7+
runBenchmark('cluster', [
8+
'n=1',
9+
'payload=string',
10+
'sendsPerBroadcast=1',
11+
'serialization=json',
12+
]);

test/benchmark/test-benchmark-crypto.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,18 @@ if (common.hasFipsCrypto)
1010

1111
const runBenchmark = require('../common/benchmark');
1212

13-
runBenchmark('crypto', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
13+
runBenchmark('crypto',
14+
[
15+
'algo=sha256',
16+
'api=stream',
17+
'cipher=',
18+
'keylen=1024',
19+
'len=1',
20+
'n=1',
21+
'out=buffer',
22+
'size=1',
23+
'type=buf',
24+
'v=crypto',
25+
'writes=1',
26+
],
27+
{ NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });

test/benchmark/test-benchmark-dgram.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ require('../common');
44

55
const runBenchmark = require('../common/benchmark');
66

7-
// Dgram benchmarks use hardcoded ports. Thus, this test can not be run in
8-
// parallel with tests that choose random ports.
7+
// Because the dgram benchmarks use hardcoded ports, this should be in
8+
// sequential rather than parallel to make sure it does not conflict with
9+
// tests that choose random available ports.
910

10-
runBenchmark('dgram');
11+
runBenchmark('dgram', ['address=true',
12+
'chunks=2',
13+
'dur=0.1',
14+
'len=1',
15+
'n=1',
16+
'num=1',
17+
'type=send']);

test/benchmark/test-benchmark-dns.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ require('../common');
44

55
const runBenchmark = require('../common/benchmark');
66

7-
runBenchmark('dns', { ...process.env, NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
7+
const env = { ...process.env, NODEJS_BENCHMARK_ZERO_ALLOWED: 1 };
8+
9+
runBenchmark('dns', ['n=1', 'all=false', 'name=127.0.0.1'], env);

test/benchmark/test-benchmark-domain.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ require('../common');
44

55
const runBenchmark = require('../common/benchmark');
66

7-
runBenchmark('domain');
7+
runBenchmark('domain', ['n=1', 'args=0']);

test/benchmark/test-benchmark-es.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,15 @@ require('../common');
44

55
const runBenchmark = require('../common/benchmark');
66

7-
runBenchmark('es', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
7+
runBenchmark('es',
8+
[
9+
'method=',
10+
'count=1',
11+
'context=null',
12+
'rest=0',
13+
'mode=',
14+
'n=1',
15+
'encoding=ascii',
16+
'size=1e1'
17+
],
18+
{ NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });

0 commit comments

Comments
 (0)