Skip to content

Commit

Permalink
Revert "test: refactor all benchmark tests to use the new test option"
Browse files Browse the repository at this point in the history
This reverts commit 78aa348.

Refs: #31396
PR-URL: #31722
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
addaleax authored and codebytere committed Feb 17, 2020
1 parent 30f55ce commit 5b3c4b3
Show file tree
Hide file tree
Showing 32 changed files with 322 additions and 34 deletions.
13 changes: 12 additions & 1 deletion test/benchmark/test-benchmark-assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,15 @@ require('../common');

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

runBenchmark('assert');
runBenchmark(
'assert',
[
'strict=1',
'len=1',
'method=',
'n=1',
'primitive=null',
'size=1',
'type=Int8Array'
]
);
9 changes: 8 additions & 1 deletion test/benchmark/test-benchmark-async-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,11 @@ if (!common.enoughTestMem)

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

runBenchmark('async_hooks');
runBenchmark('async_hooks',
[
'asyncHooks=all',
'connections=50',
'method=trackingDisabled',
'n=10'
],
{});
28 changes: 27 additions & 1 deletion test/benchmark/test-benchmark-buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,30 @@ require('../common');

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

runBenchmark('buffers', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
runBenchmark('buffers',
[
'aligned=true',
'args=1',
'buffer=fast',
'bytes=0',
'byteLength=1',
'charsPerLine=6',
'difflen=false',
'encoding=utf8',
'endian=BE',
'extraSize=1',
'len=256',
'linesCount=1',
'method=',
'n=1',
'partial=true',
'pieces=1',
'pieceSize=1',
'search=@',
'size=1',
'source=array',
'type=',
'value=0',
'withTotalLength=0'
],
{ NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
10 changes: 9 additions & 1 deletion test/benchmark/test-benchmark-child-process.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@ require('../common');

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

runBenchmark('child_process', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
runBenchmark('child_process',
[
'dur=0',
'n=1',
'len=1',
'params=1',
'methodName=execSync',
],
{ NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
7 changes: 6 additions & 1 deletion test/benchmark/test-benchmark-cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ require('../common');

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

runBenchmark('cluster');
runBenchmark('cluster', [
'n=1',
'payload=string',
'sendsPerBroadcast=1',
'serialization=json',
]);
16 changes: 15 additions & 1 deletion test/benchmark/test-benchmark-crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,18 @@ if (common.hasFipsCrypto)

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

runBenchmark('crypto', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
runBenchmark('crypto',
[
'algo=sha256',
'api=stream',
'cipher=',
'keylen=1024',
'len=1',
'n=1',
'out=buffer',
'size=1',
'type=buf',
'v=crypto',
'writes=1',
],
{ NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
13 changes: 10 additions & 3 deletions test/benchmark/test-benchmark-dgram.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ require('../common');

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

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

runBenchmark('dgram');
runBenchmark('dgram', ['address=true',
'chunks=2',
'dur=0.1',
'len=1',
'n=1',
'num=1',
'type=send']);
4 changes: 3 additions & 1 deletion test/benchmark/test-benchmark-dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ require('../common');

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

runBenchmark('dns', { ...process.env, NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
const env = { ...process.env, NODEJS_BENCHMARK_ZERO_ALLOWED: 1 };

runBenchmark('dns', ['n=1', 'all=false', 'name=127.0.0.1'], env);
2 changes: 1 addition & 1 deletion test/benchmark/test-benchmark-domain.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ require('../common');

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

runBenchmark('domain');
runBenchmark('domain', ['n=1', 'args=0']);
13 changes: 12 additions & 1 deletion test/benchmark/test-benchmark-es.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,15 @@ require('../common');

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

runBenchmark('es', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
runBenchmark('es',
[
'method=',
'count=1',
'context=null',
'rest=0',
'mode=',
'n=1',
'encoding=ascii',
'size=1e1'
],
{ NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
4 changes: 3 additions & 1 deletion test/benchmark/test-benchmark-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ require('../common');

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

runBenchmark('events', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
runBenchmark('events',
['argc=0', 'listeners=1', 'n=1'],
{ NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
17 changes: 16 additions & 1 deletion test/benchmark/test-benchmark-fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,19 @@ const runBenchmark = require('../common/benchmark');
const tmpdir = require('../common/tmpdir');
tmpdir.refresh();

runBenchmark('fs', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
runBenchmark('fs', [
'bufferSize=32',
'concurrent=1',
'dir=.github',
'dur=0.1',
'encodingType=buf',
'filesize=1024',
'len=1024',
'mode=callback',
'n=1',
'pathType=relative',
'size=1',
'statSyncType=fstatSync',
'statType=fstat',
'withFileTypes=false',
], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
25 changes: 24 additions & 1 deletion test/benchmark/test-benchmark-http.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,27 @@ if (!common.enoughTestMem)

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

runBenchmark('http', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
runBenchmark('http',
[
'benchmarker=test-double-http',
'arg=string',
'c=1',
'chunkedEnc=true',
'chunks=0',
'dur=0.1',
'e=0',
'input=keep-alive',
'key=""',
'len=1',
'method=write',
'n=1',
'res=normal',
'type=asc',
'url=long',
'value=X-Powered-By',
'w=0',
],
{
NODEJS_BENCHMARK_ZERO_ALLOWED: 1,
duration: 0
});
15 changes: 14 additions & 1 deletion test/benchmark/test-benchmark-http2.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,17 @@ if (!common.enoughTestMem)

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

runBenchmark('http2', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
runBenchmark('http2',
[
'benchmarker=test-double-http2',
'clients=1',
'length=65536',
'n=1',
'nheaders=0',
'requests=1',
'streams=1'
],
{
NODEJS_BENCHMARK_ZERO_ALLOWED: 1,
duration: 0
});
12 changes: 11 additions & 1 deletion test/benchmark/test-benchmark-misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,14 @@ require('../common');

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

runBenchmark('misc', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
runBenchmark('misc', [
'concat=0',
'dur=0.1',
'method=',
'n=1',
'type=',
'code=1',
'val=magyarország.icom.museum',
'script=test/fixtures/semicolon',
'mode=worker'
], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
10 changes: 9 additions & 1 deletion test/benchmark/test-benchmark-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@ require('../common');

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

runBenchmark('module');
runBenchmark('module', [
'cache=true',
'dir=rel',
'ext=',
'fullPath=true',
'n=1',
'name=/',
'useCache=true',
]);
8 changes: 7 additions & 1 deletion test/benchmark/test-benchmark-napi.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,10 @@ if (process.features.debug) {
}
const runBenchmark = require('../common/benchmark');

runBenchmark('napi', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
runBenchmark('napi',
[
'n=1',
'engine=v8',
'type=String'
],
{ NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
11 changes: 10 additions & 1 deletion test/benchmark/test-benchmark-net.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,13 @@ require('../common');

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

runBenchmark('net', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
runBenchmark('net',
[
'dur=0',
'len=1024',
'recvbufgenfn=false',
'recvbuflen=0',
'sendchunklen=256',
'type=buf'
],
{ NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
2 changes: 1 addition & 1 deletion test/benchmark/test-benchmark-os.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ require('../common');

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

runBenchmark('os');
runBenchmark('os', ['n=1']);
9 changes: 8 additions & 1 deletion test/benchmark/test-benchmark-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,11 @@ require('../common');

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

runBenchmark('path', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
runBenchmark('path',
[
'n=1',
'path=',
'pathext=',
'paths=',
'props='
], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
7 changes: 6 additions & 1 deletion test/benchmark/test-benchmark-process.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ require('../common');

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

runBenchmark('process', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
runBenchmark('process',
[
'n=1',
'type=raw',
'operation=enumerate',
], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
7 changes: 6 additions & 1 deletion test/benchmark/test-benchmark-querystring.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ require('../common');

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

runBenchmark('querystring', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
runBenchmark('querystring',
[ 'n=1',
'input="there is nothing to unescape here"',
'type=noencode'
],
{ NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
11 changes: 10 additions & 1 deletion test/benchmark/test-benchmark-streams.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,13 @@ require('../common');

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

runBenchmark('streams', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
runBenchmark('streams',
[
'kind=duplex',
'n=1',
'sync=no',
'writev=no',
'callback=no',
'type=buffer',
],
{ NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
5 changes: 4 additions & 1 deletion test/benchmark/test-benchmark-string_decoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ require('../common');

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

runBenchmark('string_decoder');
runBenchmark('string_decoder', ['chunkLen=16',
'encoding=utf8',
'inLen=32',
'n=1']);
8 changes: 7 additions & 1 deletion test/benchmark/test-benchmark-timers.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@ require('../common');

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

runBenchmark('timers', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
runBenchmark('timers',
[
'direction=start',
'n=1',
'type=depth',
],
{ NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
14 changes: 13 additions & 1 deletion test/benchmark/test-benchmark-tls.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,16 @@ if (!common.enoughTestMem)

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

runBenchmark('tls', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
runBenchmark('tls',
[
'concurrency=1',
'dur=0.1',
'n=1',
'size=2',
'securing=SecurePair',
'type=asc'
],
{
NODEJS_BENCHMARK_ZERO_ALLOWED: 1,
duration: 0
});
Loading

0 comments on commit 5b3c4b3

Please sign in to comment.