Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
benchmark: swap var for let in benchmarks
In benchmark directory this changes for loops
using var to let when it applies for consistency
  • Loading branch information
RamirezAlex committed Feb 3, 2020
commit 7b0a8c8ce657290a9420cd68d363b8fc8722a0c5
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