Skip to content

Commit 83c6d6b

Browse files
keondoian-perkins
authored andcommitted
benchmark: fix issues in dns
The benchmark script for dns contained functions with args declared but never used. This fix removes those arguments from the function signatures. No test existed for the dns benchmark so one was added to the parallel suite. The dns benchmark uses the core dns.lookup() function which does not access the network. To improve performance the tests are limited to 1 invocation to a single endpoint.
1 parent 3a77692 commit 83c6d6b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

benchmark/dns/lookup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const bench = common.createBenchmark(main, {
1212
function main(conf) {
1313
const name = conf.name;
1414
const n = +conf.n;
15-
const all = !!conf.all;
15+
const all = conf.all === 'true' ? true : false;
1616
var i = 0;
1717

1818
if (all) {

test/parallel/test-benchmark-dns.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ const env = Object.assign({}, process.env,
1515
{ NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });
1616

1717
const child = fork(runjs,
18-
['--set', 'n=5e4',
18+
['--set', 'n=1',
19+
'--set', 'all=false',
20+
'--set', 'name=127.0.0.1',
1921
'dns'],
2022
{ env });
2123

0 commit comments

Comments
 (0)