Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

benchmark swap var for let refactor in for loops #28958

Closed
wants to merge 6 commits into from
Closed
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
RamirezAlex committed Feb 3, 2020

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit 7b0a8c8ce657290a9420cd68d363b8fc8722a0c5
2 changes: 1 addition & 1 deletion benchmark/module/module-loader-deep.js
Original file line number Diff line number Diff line change
@@ -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`,
2 changes: 1 addition & 1 deletion benchmark/module/module-loader.js
Original file line number Diff line number Diff line change
@@ -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`,
2 changes: 1 addition & 1 deletion benchmark/string_decoder/string-decoder-create.js
Original file line number Diff line number Diff line change
@@ -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;
}
2 changes: 1 addition & 1 deletion benchmark/tls/convertprotocols.js
Original file line number Diff line number Diff line change
@@ -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
@@ -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();
}

2 changes: 1 addition & 1 deletion benchmark/v8/get-stats.js
Original file line number Diff line number Diff line change
@@ -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
@@ -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);