Skip to content

Commit 5b3c4b3

Browse files
addaleaxcodebytere
authored andcommitted
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 30f55ce commit 5b3c4b3

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 });

test/benchmark/test-benchmark-events.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('events', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
7+
runBenchmark('events',
8+
['argc=0', 'listeners=1', 'n=1'],
9+
{ NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });

test/benchmark/test-benchmark-fs.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,19 @@ const runBenchmark = require('../common/benchmark');
66
const tmpdir = require('../common/tmpdir');
77
tmpdir.refresh();
88

9-
runBenchmark('fs', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
9+
runBenchmark('fs', [
10+
'bufferSize=32',
11+
'concurrent=1',
12+
'dir=.github',
13+
'dur=0.1',
14+
'encodingType=buf',
15+
'filesize=1024',
16+
'len=1024',
17+
'mode=callback',
18+
'n=1',
19+
'pathType=relative',
20+
'size=1',
21+
'statSyncType=fstatSync',
22+
'statType=fstat',
23+
'withFileTypes=false',
24+
], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });

test/benchmark/test-benchmark-http.js

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

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

14-
runBenchmark('http', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
14+
runBenchmark('http',
15+
[
16+
'benchmarker=test-double-http',
17+
'arg=string',
18+
'c=1',
19+
'chunkedEnc=true',
20+
'chunks=0',
21+
'dur=0.1',
22+
'e=0',
23+
'input=keep-alive',
24+
'key=""',
25+
'len=1',
26+
'method=write',
27+
'n=1',
28+
'res=normal',
29+
'type=asc',
30+
'url=long',
31+
'value=X-Powered-By',
32+
'w=0',
33+
],
34+
{
35+
NODEJS_BENCHMARK_ZERO_ALLOWED: 1,
36+
duration: 0
37+
});

test/benchmark/test-benchmark-http2.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,17 @@ if (!common.enoughTestMem)
1313

1414
const runBenchmark = require('../common/benchmark');
1515

16-
runBenchmark('http2', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
16+
runBenchmark('http2',
17+
[
18+
'benchmarker=test-double-http2',
19+
'clients=1',
20+
'length=65536',
21+
'n=1',
22+
'nheaders=0',
23+
'requests=1',
24+
'streams=1'
25+
],
26+
{
27+
NODEJS_BENCHMARK_ZERO_ALLOWED: 1,
28+
duration: 0
29+
});

test/benchmark/test-benchmark-misc.js

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

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

7-
runBenchmark('misc', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
7+
runBenchmark('misc', [
8+
'concat=0',
9+
'dur=0.1',
10+
'method=',
11+
'n=1',
12+
'type=',
13+
'code=1',
14+
'val=magyarország.icom.museum',
15+
'script=test/fixtures/semicolon',
16+
'mode=worker'
17+
], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });

test/benchmark/test-benchmark-module.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('module');
7+
runBenchmark('module', [
8+
'cache=true',
9+
'dir=rel',
10+
'ext=',
11+
'fullPath=true',
12+
'n=1',
13+
'name=/',
14+
'useCache=true',
15+
]);

test/benchmark/test-benchmark-napi.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,10 @@ if (process.features.debug) {
1515
}
1616
const runBenchmark = require('../common/benchmark');
1717

18-
runBenchmark('napi', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
18+
runBenchmark('napi',
19+
[
20+
'n=1',
21+
'engine=v8',
22+
'type=String'
23+
],
24+
{ NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });

test/benchmark/test-benchmark-net.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,13 @@ require('../common');
88

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

11-
runBenchmark('net', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
11+
runBenchmark('net',
12+
[
13+
'dur=0',
14+
'len=1024',
15+
'recvbufgenfn=false',
16+
'recvbuflen=0',
17+
'sendchunklen=256',
18+
'type=buf'
19+
],
20+
{ NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });

test/benchmark/test-benchmark-os.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('os');
7+
runBenchmark('os', ['n=1']);

test/benchmark/test-benchmark-path.js

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

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

7-
runBenchmark('path', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
7+
runBenchmark('path',
8+
[
9+
'n=1',
10+
'path=',
11+
'pathext=',
12+
'paths=',
13+
'props='
14+
], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });

test/benchmark/test-benchmark-process.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('process', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
7+
runBenchmark('process',
8+
[
9+
'n=1',
10+
'type=raw',
11+
'operation=enumerate',
12+
], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });

test/benchmark/test-benchmark-querystring.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('querystring', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
7+
runBenchmark('querystring',
8+
[ 'n=1',
9+
'input="there is nothing to unescape here"',
10+
'type=noencode'
11+
],
12+
{ NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });

test/benchmark/test-benchmark-streams.js

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

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

7-
runBenchmark('streams', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
7+
runBenchmark('streams',
8+
[
9+
'kind=duplex',
10+
'n=1',
11+
'sync=no',
12+
'writev=no',
13+
'callback=no',
14+
'type=buffer',
15+
],
16+
{ NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });

test/benchmark/test-benchmark-string_decoder.js

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

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

7-
runBenchmark('string_decoder');
7+
runBenchmark('string_decoder', ['chunkLen=16',
8+
'encoding=utf8',
9+
'inLen=32',
10+
'n=1']);

test/benchmark/test-benchmark-timers.js

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

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

7-
runBenchmark('timers', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
7+
runBenchmark('timers',
8+
[
9+
'direction=start',
10+
'n=1',
11+
'type=depth',
12+
],
13+
{ NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });

test/benchmark/test-benchmark-tls.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,16 @@ if (!common.enoughTestMem)
1414

1515
const runBenchmark = require('../common/benchmark');
1616

17-
runBenchmark('tls', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
17+
runBenchmark('tls',
18+
[
19+
'concurrency=1',
20+
'dur=0.1',
21+
'n=1',
22+
'size=2',
23+
'securing=SecurePair',
24+
'type=asc'
25+
],
26+
{
27+
NODEJS_BENCHMARK_ZERO_ALLOWED: 1,
28+
duration: 0
29+
});

0 commit comments

Comments
 (0)