diff --git a/benchmark/child_process/child-process-exec-stdout.js b/benchmark/child_process/child-process-exec-stdout.js index 1e78d445f8376d..a891026b86971f 100644 --- a/benchmark/child_process/child-process-exec-stdout.js +++ b/benchmark/child_process/child-process-exec-stdout.js @@ -12,12 +12,10 @@ const bench = common.createBenchmark(childProcessExecStdout, { dur: [5] }); -function childProcessExecStdout(conf) { +function childProcessExecStdout({ dur, len }) { bench.start(); - const maxDuration = conf.dur * 1000; - const len = +conf.len; - + const maxDuration = dur * 1000; const cmd = `yes "${'.'.repeat(len)}"`; const child = exec(cmd, { 'stdio': ['ignore', 'pipe', 'ignore'] }); diff --git a/benchmark/child_process/child-process-params.js b/benchmark/child_process/child-process-params.js index 644b2136a0f03f..df930395b2a015 100644 --- a/benchmark/child_process/child-process-params.js +++ b/benchmark/child_process/child-process-params.js @@ -20,11 +20,7 @@ const configs = { const bench = common.createBenchmark(main, configs); -function main(conf) { - const n = +conf.n; - const methodName = conf.methodName; - const params = +conf.params; - +function main({ n, methodName, params }) { const method = cp[methodName]; switch (methodName) { diff --git a/benchmark/child_process/child-process-read-ipc.js b/benchmark/child_process/child-process-read-ipc.js index e6fb9b19c202dc..3971eb8b39663e 100644 --- a/benchmark/child_process/child-process-read-ipc.js +++ b/benchmark/child_process/child-process-read-ipc.js @@ -18,11 +18,9 @@ if (process.argv[2] === 'child') { dur: [5] }); const spawn = require('child_process').spawn; - function main(conf) { - bench.start(); - const dur = +conf.dur; - const len = +conf.len; + function main({ dur, len }) { + bench.start(); const options = { 'stdio': ['ignore', 1, 2, 'ipc'] }; const child = spawn(process.argv[0], diff --git a/benchmark/child_process/child-process-read.js b/benchmark/child_process/child-process-read.js index 91c9964e8d1414..0ff08af79483b8 100644 --- a/benchmark/child_process/child-process-read.js +++ b/benchmark/child_process/child-process-read.js @@ -17,12 +17,9 @@ const bench = common.createBenchmark(main, { dur: [5] }); -function main(conf) { +function main({ dur, len }) { bench.start(); - const dur = +conf.dur; - const len = +conf.len; - const msg = `"${'.'.repeat(len)}"`; const options = { 'stdio': ['ignore', 'pipe', 'ignore'] }; const child = child_process.spawn('yes', [msg], options); diff --git a/benchmark/child_process/spawn-echo.js b/benchmark/child_process/spawn-echo.js index 1ce40c3abf4541..62f46fb4c0e8b4 100644 --- a/benchmark/child_process/spawn-echo.js +++ b/benchmark/child_process/spawn-echo.js @@ -5,9 +5,7 @@ const bench = common.createBenchmark(main, { }); const spawn = require('child_process').spawn; -function main(conf) { - const n = +conf.n; - +function main({ n }) { bench.start(); go(n, n); }