Skip to content

Commit

Permalink
benchmark: swap var for let in benchmarks
Browse files Browse the repository at this point in the history
In benchmark directory this changes for loops
using var to let when it applies for consistency
  • Loading branch information
RamirezAlex committed Feb 3, 2020
1 parent ea0ffdb commit 7b0a8c8
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion benchmark/module/module-loader-deep.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function main({ ext, cache, files }) {
`${benchmarkDirectory}/a.js`,
'module.exports = {};'
);
for (var i = 0; i <= files; i++) {
for (let i = 0; i <= files; i++) {
fs.mkdirSync(`${benchmarkDirectory}/${i}`);
fs.writeFileSync(
`${benchmarkDirectory}/${i}/package.json`,
Expand Down
2 changes: 1 addition & 1 deletion benchmark/module/module-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const bench = common.createBenchmark(main, {
function main({ n, name, cache, files, dir }) {
tmpdir.refresh();
fs.mkdirSync(benchmarkDirectory);
for (var i = 0; i <= files; i++) {
for (let i = 0; i <= files; i++) {
fs.mkdirSync(`${benchmarkDirectory}${i}`);
fs.writeFileSync(
`${benchmarkDirectory}${i}/package.json`,
Expand Down
2 changes: 1 addition & 1 deletion benchmark/string_decoder/string-decoder-create.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const bench = common.createBenchmark(main, {

function main({ encoding, n }) {
bench.start();
for (var i = 0; i < n; ++i) {
for (let i = 0; i < n; ++i) {
const sd = new StringDecoder(encoding);
!!sd.encoding;
}
Expand Down
2 changes: 1 addition & 1 deletion benchmark/tls/convertprotocols.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function main({ n }) {
m = {};
}
bench.start();
for (var i = 0; i < n; i++)
for (let i = 0; i < n; i++)
tls.convertALPNProtocols(input, m);
bench.end(n);
}
2 changes: 1 addition & 1 deletion benchmark/tls/tls-connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function main(conf) {
function onListening() {
setTimeout(done, dur * 1000);
bench.start();
for (var i = 0; i < concurrency; i++)
for (let i = 0; i < concurrency; i++)
makeConnection();
}

Expand Down
2 changes: 1 addition & 1 deletion benchmark/v8/get-stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const bench = common.createBenchmark(main, {

function main({ method, n }) {
bench.start();
for (var i = 0; i < n; i++)
for (let i = 0; i < n; i++)
v8[method]();
bench.end(n);
}
2 changes: 1 addition & 1 deletion benchmark/worker/echo.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function main({ n, workers, sendsPerBroadcast: sends, payload: payloadType }) {

const workerObjs = [];

for (var i = 0; i < workers; ++i) {
for (let i = 0; i < workers; ++i) {
const worker = new Worker(workerPath);
workerObjs.push(worker);
worker.on('online', onOnline);
Expand Down

0 comments on commit 7b0a8c8

Please sign in to comment.