diff options
Diffstat (limited to 'benchmark/dgram')
-rw-r--r-- | benchmark/dgram/array-vs-concat.js | 12 | ||||
-rw-r--r-- | benchmark/dgram/multi-buffer.js | 10 | ||||
-rw-r--r-- | benchmark/dgram/offset-length.js | 10 | ||||
-rw-r--r-- | benchmark/dgram/single-buffer.js | 10 |
4 files changed, 21 insertions, 21 deletions
diff --git a/benchmark/dgram/array-vs-concat.js b/benchmark/dgram/array-vs-concat.js index 681abd6afa1..7ee4e2d3acb 100644 --- a/benchmark/dgram/array-vs-concat.js +++ b/benchmark/dgram/array-vs-concat.js @@ -7,7 +7,7 @@ const PORT = common.PORT; // `num` is the number of send requests to queue up each time. // Keep it reasonably high (>10) otherwise you're benchmarking the speed of // event loop cycles more than anything else. -var bench = common.createBenchmark(main, { +const bench = common.createBenchmark(main, { len: [64, 256, 512, 1024], num: [100], chunks: [1, 2, 4, 8], @@ -37,13 +37,13 @@ function main(conf) { server(); } -var dgram = require('dgram'); +const dgram = require('dgram'); function server() { var sent = 0; - var socket = dgram.createSocket('udp4'); + const socket = dgram.createSocket('udp4'); - var onsend = type === 'concat' ? onsendConcat : onsendMulti; + const onsend = type === 'concat' ? onsendConcat : onsendMulti; function onsendConcat() { if (sent++ % num === 0) { @@ -66,8 +66,8 @@ function server() { onsend(); setTimeout(function() { - var bytes = sent * len; - var gbits = (bytes * 8) / (1024 * 1024 * 1024); + const bytes = sent * len; + const gbits = (bytes * 8) / (1024 * 1024 * 1024); bench.end(gbits); process.exit(0); }, dur * 1000); diff --git a/benchmark/dgram/multi-buffer.js b/benchmark/dgram/multi-buffer.js index a0285c8c59e..15f70760abf 100644 --- a/benchmark/dgram/multi-buffer.js +++ b/benchmark/dgram/multi-buffer.js @@ -7,7 +7,7 @@ const PORT = common.PORT; // `num` is the number of send requests to queue up each time. // Keep it reasonably high (>10) otherwise you're benchmarking the speed of // event loop cycles more than anything else. -var bench = common.createBenchmark(main, { +const bench = common.createBenchmark(main, { len: [64, 256, 1024], num: [100], chunks: [1, 2, 4, 8], @@ -37,12 +37,12 @@ function main(conf) { server(); } -var dgram = require('dgram'); +const dgram = require('dgram'); function server() { var sent = 0; var received = 0; - var socket = dgram.createSocket('udp4'); + const socket = dgram.createSocket('udp4'); function onsend() { if (sent++ % num === 0) { @@ -57,8 +57,8 @@ function server() { onsend(); setTimeout(function() { - var bytes = (type === 'send' ? sent : received) * len; - var gbits = (bytes * 8) / (1024 * 1024 * 1024); + const bytes = (type === 'send' ? sent : received) * len; + const gbits = (bytes * 8) / (1024 * 1024 * 1024); bench.end(gbits); process.exit(0); }, dur * 1000); diff --git a/benchmark/dgram/offset-length.js b/benchmark/dgram/offset-length.js index 0445f7b70be..7f5a02afe58 100644 --- a/benchmark/dgram/offset-length.js +++ b/benchmark/dgram/offset-length.js @@ -7,7 +7,7 @@ const PORT = common.PORT; // `num` is the number of send requests to queue up each time. // Keep it reasonably high (>10) otherwise you're benchmarking the speed of // event loop cycles more than anything else. -var bench = common.createBenchmark(main, { +const bench = common.createBenchmark(main, { len: [1, 64, 256, 1024], num: [100], type: ['send', 'recv'], @@ -29,12 +29,12 @@ function main(conf) { server(); } -var dgram = require('dgram'); +const dgram = require('dgram'); function server() { var sent = 0; var received = 0; - var socket = dgram.createSocket('udp4'); + const socket = dgram.createSocket('udp4'); function onsend() { if (sent++ % num === 0) { @@ -49,8 +49,8 @@ function server() { onsend(); setTimeout(function() { - var bytes = (type === 'send' ? sent : received) * chunk.length; - var gbits = (bytes * 8) / (1024 * 1024 * 1024); + const bytes = (type === 'send' ? sent : received) * chunk.length; + const gbits = (bytes * 8) / (1024 * 1024 * 1024); bench.end(gbits); process.exit(0); }, dur * 1000); diff --git a/benchmark/dgram/single-buffer.js b/benchmark/dgram/single-buffer.js index e5fcac63f64..454662b5425 100644 --- a/benchmark/dgram/single-buffer.js +++ b/benchmark/dgram/single-buffer.js @@ -7,7 +7,7 @@ const PORT = common.PORT; // `num` is the number of send requests to queue up each time. // Keep it reasonably high (>10) otherwise you're benchmarking the speed of // event loop cycles more than anything else. -var bench = common.createBenchmark(main, { +const bench = common.createBenchmark(main, { len: [1, 64, 256, 1024], num: [100], type: ['send', 'recv'], @@ -29,12 +29,12 @@ function main(conf) { server(); } -var dgram = require('dgram'); +const dgram = require('dgram'); function server() { var sent = 0; var received = 0; - var socket = dgram.createSocket('udp4'); + const socket = dgram.createSocket('udp4'); function onsend() { if (sent++ % num === 0) { @@ -49,8 +49,8 @@ function server() { onsend(); setTimeout(function() { - var bytes = (type === 'send' ? sent : received) * chunk.length; - var gbits = (bytes * 8) / (1024 * 1024 * 1024); + const bytes = (type === 'send' ? sent : received) * chunk.length; + const gbits = (bytes * 8) / (1024 * 1024 * 1024); bench.end(gbits); process.exit(0); }, dur * 1000); |