diff --git a/benchmark/dgram/single-buffer.js b/benchmark/dgram/single-buffer.js index 6a7fa3dde22942..bab8cee1594f24 100644 --- a/benchmark/dgram/single-buffer.js +++ b/benchmark/dgram/single-buffer.js @@ -10,23 +10,23 @@ const PORT = common.PORT; // event loop cycles more than anything else. const bench = common.createBenchmark(main, { len: [1, 64, 256, 1024], - num: [100], + n: [100], type: ['send', 'recv'], dur: [5], }); -function main({ dur, len, num, type }) { +function main({ dur, len, num: n, type }) { const chunk = Buffer.allocUnsafe(len); let sent = 0; let received = 0; const socket = dgram.createSocket('udp4'); function onsend() { - if (sent++ % num === 0) { + if (sent++ % n === 0) { // The setImmediate() is necessary to have event loop progress on OSes // that only perform synchronous I/O on nonblocking UDP sockets. setImmediate(() => { - for (let i = 0; i < num; i++) { + for (let i = 0; i < n; i++) { socket.send(chunk, PORT, '127.0.0.1', onsend); } }); diff --git a/benchmark/permission/permission-startup.js b/benchmark/permission/permission-startup.js index 6a197cdff56111..d95caa01f605e0 100644 --- a/benchmark/permission/permission-startup.js +++ b/benchmark/permission/permission-startup.js @@ -19,12 +19,12 @@ const bench = common.createBenchmark(main, { ], prefixPath: ['/tmp'], nFiles: [10, 100, 1000], - count: [30], + n: [30], }); function spawnProcess(script, bench, state) { const cmd = process.execPath || process.argv[0]; - while (state.finished < state.count) { + while (state.finished < state.n) { const child = spawnSync(cmd, script); if (child.status !== 0) { console.log('---- STDOUT ----'); @@ -39,13 +39,13 @@ function spawnProcess(script, bench, state) { bench.start(); } - if (state.finished === state.count) { - bench.end(state.count); + if (state.finished === state.n) { + bench.end(state.n); } } } -function main({ count, script, nFiles, prefixPath }) { +function main({ n, script, nFiles, prefixPath }) { script = path.resolve(__dirname, '../../', `${script}.js`); const optionsWithScript = [ '--permission', @@ -54,6 +54,6 @@ function main({ count, script, nFiles, prefixPath }) { script, ]; const warmup = 3; - const state = { count, finished: -warmup }; + const state = { n, finished: -warmup }; spawnProcess(optionsWithScript, bench, state); } diff --git a/benchmark/util/priority-queue.js b/benchmark/util/priority-queue.js index 2301c5a1ef6892..0a880a1c7cf29d 100644 --- a/benchmark/util/priority-queue.js +++ b/benchmark/util/priority-queue.js @@ -6,7 +6,7 @@ const bench = common.createBenchmark(main, { n: [1e5], }, { flags: ['--expose-internals'] }); -function main({ n, type }) { +function main({ n }) { const PriorityQueue = require('internal/priority_queue'); const queue = new PriorityQueue(); bench.start();