diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2020-01-16 15:56:49 +0100 |
---|---|---|
committer | Shelley Vohr <shelley.vohr@gmail.com> | 2020-02-17 12:21:05 -0800 |
commit | 4878c7a19781f4bf6db157f5761ae65788c5b3fe (patch) | |
tree | 6ad726ae53597a757dfd5bd6b12407fc4fe689d8 /test/benchmark | |
parent | ca343caee3362d5f06626b1887fca0d13b928722 (diff) | |
download | node-new-4878c7a19781f4bf6db157f5761ae65788c5b3fe.tar.gz |
test: refactor all benchmark tests to use the new test option
PR-URL: https://github.com/nodejs/node/pull/31396
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test/benchmark')
32 files changed, 34 insertions, 322 deletions
diff --git a/test/benchmark/test-benchmark-assert.js b/test/benchmark/test-benchmark-assert.js index 8a8ba02444..5ec2319c28 100644 --- a/test/benchmark/test-benchmark-assert.js +++ b/test/benchmark/test-benchmark-assert.js @@ -7,15 +7,4 @@ require('../common'); const runBenchmark = require('../common/benchmark'); -runBenchmark( - 'assert', - [ - 'strict=1', - 'len=1', - 'method=', - 'n=1', - 'primitive=null', - 'size=1', - 'type=Int8Array' - ] -); +runBenchmark('assert'); diff --git a/test/benchmark/test-benchmark-async-hooks.js b/test/benchmark/test-benchmark-async-hooks.js index 9951d8c933..c9ea2c1e86 100644 --- a/test/benchmark/test-benchmark-async-hooks.js +++ b/test/benchmark/test-benchmark-async-hooks.js @@ -10,11 +10,4 @@ if (!common.enoughTestMem) const runBenchmark = require('../common/benchmark'); -runBenchmark('async_hooks', - [ - 'asyncHooks=all', - 'connections=50', - 'method=trackingDisabled', - 'n=10' - ], - {}); +runBenchmark('async_hooks'); diff --git a/test/benchmark/test-benchmark-buffer.js b/test/benchmark/test-benchmark-buffer.js index 57130ffb08..af93842b0b 100644 --- a/test/benchmark/test-benchmark-buffer.js +++ b/test/benchmark/test-benchmark-buffer.js @@ -4,30 +4,4 @@ require('../common'); const runBenchmark = require('../common/benchmark'); -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 }); +runBenchmark('buffers', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/benchmark/test-benchmark-child-process.js b/test/benchmark/test-benchmark-child-process.js index 365777069b..043620de12 100644 --- a/test/benchmark/test-benchmark-child-process.js +++ b/test/benchmark/test-benchmark-child-process.js @@ -4,12 +4,4 @@ require('../common'); const runBenchmark = require('../common/benchmark'); -runBenchmark('child_process', - [ - 'dur=0', - 'n=1', - 'len=1', - 'params=1', - 'methodName=execSync', - ], - { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); +runBenchmark('child_process', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/benchmark/test-benchmark-cluster.js b/test/benchmark/test-benchmark-cluster.js index 26df7ec239..b24aced5d5 100644 --- a/test/benchmark/test-benchmark-cluster.js +++ b/test/benchmark/test-benchmark-cluster.js @@ -4,9 +4,4 @@ require('../common'); const runBenchmark = require('../common/benchmark'); -runBenchmark('cluster', [ - 'n=1', - 'payload=string', - 'sendsPerBroadcast=1', - 'serialization=json', -]); +runBenchmark('cluster'); diff --git a/test/benchmark/test-benchmark-crypto.js b/test/benchmark/test-benchmark-crypto.js index 6ba71471cf..7f6988acf2 100644 --- a/test/benchmark/test-benchmark-crypto.js +++ b/test/benchmark/test-benchmark-crypto.js @@ -10,18 +10,4 @@ if (common.hasFipsCrypto) const runBenchmark = require('../common/benchmark'); -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 }); +runBenchmark('crypto', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/benchmark/test-benchmark-dgram.js b/test/benchmark/test-benchmark-dgram.js index 8c93cd5a0c..ceafdd77a2 100644 --- a/test/benchmark/test-benchmark-dgram.js +++ b/test/benchmark/test-benchmark-dgram.js @@ -4,14 +4,7 @@ require('../common'); const runBenchmark = require('../common/benchmark'); -// 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. +// Dgram benchmarks use hardcoded ports. Thus, this test can not be run in +// parallel with tests that choose random ports. -runBenchmark('dgram', ['address=true', - 'chunks=2', - 'dur=0.1', - 'len=1', - 'n=1', - 'num=1', - 'type=send']); +runBenchmark('dgram'); diff --git a/test/benchmark/test-benchmark-dns.js b/test/benchmark/test-benchmark-dns.js index 811e9a44b9..331a4c8ff0 100644 --- a/test/benchmark/test-benchmark-dns.js +++ b/test/benchmark/test-benchmark-dns.js @@ -4,6 +4,4 @@ require('../common'); const runBenchmark = require('../common/benchmark'); -const env = { ...process.env, NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }; - -runBenchmark('dns', ['n=1', 'all=false', 'name=127.0.0.1'], env); +runBenchmark('dns', { ...process.env, NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/benchmark/test-benchmark-domain.js b/test/benchmark/test-benchmark-domain.js index e7d8b60b71..5ebbfc5ea3 100644 --- a/test/benchmark/test-benchmark-domain.js +++ b/test/benchmark/test-benchmark-domain.js @@ -4,4 +4,4 @@ require('../common'); const runBenchmark = require('../common/benchmark'); -runBenchmark('domain', ['n=1', 'args=0']); +runBenchmark('domain'); diff --git a/test/benchmark/test-benchmark-es.js b/test/benchmark/test-benchmark-es.js index 47fe4ab3f9..6886b3ce92 100644 --- a/test/benchmark/test-benchmark-es.js +++ b/test/benchmark/test-benchmark-es.js @@ -4,15 +4,4 @@ require('../common'); const runBenchmark = require('../common/benchmark'); -runBenchmark('es', - [ - 'method=', - 'count=1', - 'context=null', - 'rest=0', - 'mode=', - 'n=1', - 'encoding=ascii', - 'size=1e1' - ], - { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); +runBenchmark('es', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/benchmark/test-benchmark-events.js b/test/benchmark/test-benchmark-events.js index 06be60a84a..53de4897dd 100644 --- a/test/benchmark/test-benchmark-events.js +++ b/test/benchmark/test-benchmark-events.js @@ -4,6 +4,4 @@ require('../common'); const runBenchmark = require('../common/benchmark'); -runBenchmark('events', - ['argc=0', 'listeners=1', 'n=1'], - { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); +runBenchmark('events', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/benchmark/test-benchmark-fs.js b/test/benchmark/test-benchmark-fs.js index cf38240723..3ef6be2b7e 100644 --- a/test/benchmark/test-benchmark-fs.js +++ b/test/benchmark/test-benchmark-fs.js @@ -6,19 +6,4 @@ const runBenchmark = require('../common/benchmark'); const tmpdir = require('../common/tmpdir'); tmpdir.refresh(); -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 }); +runBenchmark('fs', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/benchmark/test-benchmark-http.js b/test/benchmark/test-benchmark-http.js index 43531ec51c..a3d92c7e98 100644 --- a/test/benchmark/test-benchmark-http.js +++ b/test/benchmark/test-benchmark-http.js @@ -11,27 +11,4 @@ if (!common.enoughTestMem) const runBenchmark = require('../common/benchmark'); -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 - }); +runBenchmark('http', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/benchmark/test-benchmark-http2.js b/test/benchmark/test-benchmark-http2.js index 1668a7b87f..25dd771076 100644 --- a/test/benchmark/test-benchmark-http2.js +++ b/test/benchmark/test-benchmark-http2.js @@ -13,17 +13,4 @@ if (!common.enoughTestMem) const runBenchmark = require('../common/benchmark'); -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 - }); +runBenchmark('http2', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/benchmark/test-benchmark-misc.js b/test/benchmark/test-benchmark-misc.js index 13bd41e540..30707bfaf7 100644 --- a/test/benchmark/test-benchmark-misc.js +++ b/test/benchmark/test-benchmark-misc.js @@ -4,14 +4,4 @@ require('../common'); const runBenchmark = require('../common/benchmark'); -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 }); +runBenchmark('misc', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/benchmark/test-benchmark-module.js b/test/benchmark/test-benchmark-module.js index 4d49ed249c..da8e108d53 100644 --- a/test/benchmark/test-benchmark-module.js +++ b/test/benchmark/test-benchmark-module.js @@ -4,12 +4,4 @@ require('../common'); const runBenchmark = require('../common/benchmark'); -runBenchmark('module', [ - 'cache=true', - 'dir=rel', - 'ext=', - 'fullPath=true', - 'n=1', - 'name=/', - 'useCache=true', -]); +runBenchmark('module'); diff --git a/test/benchmark/test-benchmark-napi.js b/test/benchmark/test-benchmark-napi.js index 1a1ff23d60..5c6a8aa011 100644 --- a/test/benchmark/test-benchmark-napi.js +++ b/test/benchmark/test-benchmark-napi.js @@ -15,10 +15,4 @@ if (process.features.debug) { } const runBenchmark = require('../common/benchmark'); -runBenchmark('napi', - [ - 'n=1', - 'engine=v8', - 'type=String' - ], - { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); +runBenchmark('napi', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/benchmark/test-benchmark-net.js b/test/benchmark/test-benchmark-net.js index f51c615b5d..df8ea80116 100644 --- a/test/benchmark/test-benchmark-net.js +++ b/test/benchmark/test-benchmark-net.js @@ -8,13 +8,4 @@ require('../common'); const runBenchmark = require('../common/benchmark'); -runBenchmark('net', - [ - 'dur=0', - 'len=1024', - 'recvbufgenfn=false', - 'recvbuflen=0', - 'sendchunklen=256', - 'type=buf' - ], - { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); +runBenchmark('net', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/benchmark/test-benchmark-os.js b/test/benchmark/test-benchmark-os.js index 836e0e6504..dbedd7f582 100644 --- a/test/benchmark/test-benchmark-os.js +++ b/test/benchmark/test-benchmark-os.js @@ -4,4 +4,4 @@ require('../common'); const runBenchmark = require('../common/benchmark'); -runBenchmark('os', ['n=1']); +runBenchmark('os'); diff --git a/test/benchmark/test-benchmark-path.js b/test/benchmark/test-benchmark-path.js index 890fd7ae41..3bca4f2a11 100644 --- a/test/benchmark/test-benchmark-path.js +++ b/test/benchmark/test-benchmark-path.js @@ -4,11 +4,4 @@ require('../common'); const runBenchmark = require('../common/benchmark'); -runBenchmark('path', - [ - 'n=1', - 'path=', - 'pathext=', - 'paths=', - 'props=' - ], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); +runBenchmark('path', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/benchmark/test-benchmark-process.js b/test/benchmark/test-benchmark-process.js index a73fc075bf..c6687f3023 100644 --- a/test/benchmark/test-benchmark-process.js +++ b/test/benchmark/test-benchmark-process.js @@ -4,9 +4,4 @@ require('../common'); const runBenchmark = require('../common/benchmark'); -runBenchmark('process', - [ - 'n=1', - 'type=raw', - 'operation=enumerate', - ], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); +runBenchmark('process', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/benchmark/test-benchmark-querystring.js b/test/benchmark/test-benchmark-querystring.js index 77d0ac99ff..6fee9bb391 100644 --- a/test/benchmark/test-benchmark-querystring.js +++ b/test/benchmark/test-benchmark-querystring.js @@ -4,9 +4,4 @@ require('../common'); const runBenchmark = require('../common/benchmark'); -runBenchmark('querystring', - [ 'n=1', - 'input="there is nothing to unescape here"', - 'type=noencode' - ], - { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); +runBenchmark('querystring', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/benchmark/test-benchmark-streams.js b/test/benchmark/test-benchmark-streams.js index fa61b8dc4e..68c8478a73 100644 --- a/test/benchmark/test-benchmark-streams.js +++ b/test/benchmark/test-benchmark-streams.js @@ -4,13 +4,4 @@ require('../common'); const runBenchmark = require('../common/benchmark'); -runBenchmark('streams', - [ - 'kind=duplex', - 'n=1', - 'sync=no', - 'writev=no', - 'callback=no', - 'type=buffer', - ], - { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); +runBenchmark('streams', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/benchmark/test-benchmark-string_decoder.js b/test/benchmark/test-benchmark-string_decoder.js index f2fd6abe4b..721529e5ae 100644 --- a/test/benchmark/test-benchmark-string_decoder.js +++ b/test/benchmark/test-benchmark-string_decoder.js @@ -4,7 +4,4 @@ require('../common'); const runBenchmark = require('../common/benchmark'); -runBenchmark('string_decoder', ['chunkLen=16', - 'encoding=utf8', - 'inLen=32', - 'n=1']); +runBenchmark('string_decoder'); diff --git a/test/benchmark/test-benchmark-timers.js b/test/benchmark/test-benchmark-timers.js index af3c49bd71..db4927ab32 100644 --- a/test/benchmark/test-benchmark-timers.js +++ b/test/benchmark/test-benchmark-timers.js @@ -4,10 +4,4 @@ require('../common'); const runBenchmark = require('../common/benchmark'); -runBenchmark('timers', - [ - 'direction=start', - 'n=1', - 'type=depth', - ], - { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); +runBenchmark('timers', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/benchmark/test-benchmark-tls.js b/test/benchmark/test-benchmark-tls.js index 40c14af830..c9a87c1577 100644 --- a/test/benchmark/test-benchmark-tls.js +++ b/test/benchmark/test-benchmark-tls.js @@ -14,16 +14,4 @@ if (!common.enoughTestMem) const runBenchmark = require('../common/benchmark'); -runBenchmark('tls', - [ - 'concurrency=1', - 'dur=0.1', - 'n=1', - 'size=2', - 'securing=SecurePair', - 'type=asc' - ], - { - NODEJS_BENCHMARK_ZERO_ALLOWED: 1, - duration: 0 - }); +runBenchmark('tls', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/benchmark/test-benchmark-url.js b/test/benchmark/test-benchmark-url.js index 8560c918fd..664e7c4d8d 100644 --- a/test/benchmark/test-benchmark-url.js +++ b/test/benchmark/test-benchmark-url.js @@ -4,22 +4,4 @@ require('../common'); const runBenchmark = require('../common/benchmark'); -runBenchmark('url', - [ - 'method=legacy', - 'e=0', - 'loopMethod=forEach', - 'accessMethod=get', - 'type=short', - 'searchParam=noencode', - 'href=short', - 'input=short', - 'domain=empty', - 'path=up', - 'to=ascii', - 'prop=href', - 'n=1', - 'param=one', - 'withBase=false' - ], - { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); +runBenchmark('url', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/benchmark/test-benchmark-util.js b/test/benchmark/test-benchmark-util.js index b66d4fdb9b..d0c16c6232 100644 --- a/test/benchmark/test-benchmark-util.js +++ b/test/benchmark/test-benchmark-util.js @@ -4,17 +4,4 @@ require('../common'); const runBenchmark = require('../common/benchmark'); -runBenchmark('util', - ['argument=false', - 'input=', - 'method=Array', - 'n=1', - 'option=none', - 'pos=start', - 'size=1', - 'type=', - 'len=1', - 'version=native', - 'isProxy=1', - 'showProxy=1'], - { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); +runBenchmark('util', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/benchmark/test-benchmark-v8.js b/test/benchmark/test-benchmark-v8.js index 22861785db..efeaac8328 100644 --- a/test/benchmark/test-benchmark-v8.js +++ b/test/benchmark/test-benchmark-v8.js @@ -4,9 +4,4 @@ require('../common'); const runBenchmark = require('../common/benchmark'); -runBenchmark('v8', - [ - 'method=getHeapStatistics', - 'n=1' - ], - { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); +runBenchmark('v8', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/benchmark/test-benchmark-vm.js b/test/benchmark/test-benchmark-vm.js index 79ab6a0340..e9c4e3f138 100644 --- a/test/benchmark/test-benchmark-vm.js +++ b/test/benchmark/test-benchmark-vm.js @@ -4,10 +4,4 @@ require('../common'); const runBenchmark = require('../common/benchmark'); -runBenchmark('vm', - [ - 'breakOnSigint=0', - 'withSigintListener=0', - 'n=1' - ], - { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); +runBenchmark('vm', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/benchmark/test-benchmark-worker.js b/test/benchmark/test-benchmark-worker.js index ae9a8a6701..a4319d4fac 100644 --- a/test/benchmark/test-benchmark-worker.js +++ b/test/benchmark/test-benchmark-worker.js @@ -11,13 +11,4 @@ if (!common.enoughTestMem) const runBenchmark = require('../common/benchmark'); -runBenchmark('worker', - [ - 'n=1', - 'sendsPerBroadcast=1', - 'workers=1', - 'payload=string' - ], - { - NODEJS_BENCHMARK_ZERO_ALLOWED: 1 - }); +runBenchmark('worker', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/benchmark/test-benchmark-zlib.js b/test/benchmark/test-benchmark-zlib.js index adc7e3d47b..e3c4723aa9 100644 --- a/test/benchmark/test-benchmark-zlib.js +++ b/test/benchmark/test-benchmark-zlib.js @@ -4,17 +4,4 @@ require('../common'); const runBenchmark = require('../common/benchmark'); -runBenchmark('zlib', - [ - 'algorithm=brotli', - 'chunkLen=1024', - 'duration=0.001', - 'inputLen=1024', - 'method=', - 'n=1', - 'options=true', - 'type=Deflate', - ], - { - 'NODEJS_BENCHMARK_ZERO_ALLOWED': 1 - }); +runBenchmark('zlib', { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); |