From 1e008dab21f6cec1f97dad1c4d4e8e6ae8538b47 Mon Sep 17 00:00:00 2001 From: Bruno Rodrigues Date: Fri, 12 Sep 2025 20:31:51 +0100 Subject: [PATCH] benchmark: update num to n in dgram offset-length PR-URL: https://github.com/nodejs/node/pull/59872 Reviewed-By: Rafael Gonzaga Reviewed-By: Luigi Pinca --- benchmark/dgram/single-buffer.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/benchmark/dgram/single-buffer.js b/benchmark/dgram/single-buffer.js index 6a7fa3dde22..bab8cee1594 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); } });