Skip to content

Commit 552d887

Browse files
brunocrohtargos
authored andcommitted
benchmark: update num to n in dgram offset-length
PR-URL: #59708 Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 275c070 commit 552d887

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎benchmark/dgram/offset-length.js‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@ const common = require('../common.js');
55
constdgram=require('dgram');
66
constPORT=common.PORT;
77

8-
// `num` is the number of send requests to queue up each time.
8+
// `n` is the number of send requests to queue up each time.
99
// Keep it reasonably high (>10) otherwise you're benchmarking the speed of
1010
// event loop cycles more than anything else.
1111
constbench=common.createBenchmark(main,{
1212
len: [1,64,256,1024],
13-
num: [100],
13+
n: [100],
1414
type: ['send','recv'],
1515
dur: [5],
1616
});
1717

18-
functionmain({ dur, len,num, type }){
18+
functionmain({ dur, len,n, type }){
1919
constchunk=Buffer.allocUnsafe(len);
2020
letsent=0;
2121
letreceived=0;
2222
constsocket=dgram.createSocket('udp4');
2323

2424
functiononsend(){
25-
if(sent++%num===0){
25+
if(sent++%n===0){
2626
// The setImmediate() is necessary to have event loop progress on OSes
2727
// that only perform synchronous I/O on nonblocking UDP sockets.
2828
setImmediate(()=>{
29-
for(leti=0;i<num;i++){
29+
for(leti=0;i<n;i++){
3030
socket.send(chunk,0,chunk.length,PORT,'127.0.0.1',onsend);
3131
}
3232
});

0 commit comments

Comments
(0)