GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — benchmark: use let instead of var · ide/node@4bf888d

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • benchmark
    • module
      • module-loader-deep.js
      • module-loader.js
    • napi
      • function_args
        • index.js
      • function_call
        • index.js
    • net
      • net-c2s-cork.js
      • net-c2s.js
      • net-pipe.js
      • net-s2c.js
      • net-wrap-js-stream-passthrough.js
      • tcp-raw-c2s.js
      • tcp-raw-pipe.js
      • tcp-raw-s2c.js
    • path
      • basename-posix.js
      • basename-win32.js
      • relative-posix.js
      • relative-win32.js
    • process
      • bench-hrtime.js
      • next-tick-breadth-args.js
      • next-tick-breadth.js
      • queue-microtask-breadth.js
    • querystring
      • querystring-parse.js
    • streams
      • creation.js
      • pipe-object-mode.js
      • pipe.js
      • readable-bigread.js
      • readable-bigunevenread.js
      • readable-boundaryread.js
      • readable-readall.js
      • readable-unevenread.js
    • string_decoder
      • string-decoder.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎benchmark/module/module-loader-deep.js‎

Copy file name to clipboardExpand all lines: benchmark/module/module-loader-deep.js
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,13 @@ function main({ ext, cache, files }) {
3737
}
3838

3939
function measureDir(cache, files) {
40-
var i;
4140
if (cache) {
42-
for (i = 0; i <= files; i++) {
41+
for (let i = 0; i <= files; i++) {
4342
require(`${benchmarkDirectory}/${i}`);
4443
}
4544
}
4645
bench.start();
47-
for (i = 0; i <= files; i++) {
46+
for (let i = 0; i <= files; i++) {
4847
require(`${benchmarkDirectory}/${i}`);
4948
}
5049
bench.end(files);
Collapse file

‎benchmark/module/module-loader.js‎

Copy file name to clipboardExpand all lines: benchmark/module/module-loader.js
+3-4Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,14 @@ function main({ n, name, cache, files, dir }) {
4242
}
4343

4444
function measureDir(n, cache, files, name) {
45-
var i;
4645
if (cache) {
47-
for (i = 0; i <= files; i++) {
46+
for (let i = 0; i <= files; i++) {
4847
require(`${benchmarkDirectory}${i}${name}`);
4948
}
5049
}
5150
bench.start();
52-
for (i = 0; i <= files; i++) {
53-
for (var j = 0; j < n; j++)
51+
for (let i = 0; i <= files; i++) {
52+
for (let j = 0; j < n; j++)
5453
require(`${benchmarkDirectory}${i}${name}`);
5554
// Pretend mixed input (otherwise the results are less representative due to
5655
// highly specialized code).
Collapse file

‎benchmark/napi/function_args/index.js‎

Copy file name to clipboardExpand all lines: benchmark/napi/function_args/index.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function main({ n, engine, type }) {
8989
const args = generateArgs(type);
9090

9191
bench.start();
92-
for (var i = 0; i < n; i++) {
92+
for (let i = 0; i < n; i++) {
9393
fn.apply(null, args);
9494
}
9595
bench.end(n);
Collapse file

‎benchmark/napi/function_call/index.js‎

Copy file name to clipboardExpand all lines: benchmark/napi/function_call/index.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ try {
2929
}
3030
const napi = napi_binding.hello;
3131

32-
var c = 0;
32+
let c = 0;
3333
function js() {
3434
return c++;
3535
}
@@ -44,7 +44,7 @@ const bench = common.createBenchmark(main, {
4444
function main({ n, type }) {
4545
const fn = type === 'cxx' ? cxx : type === 'napi' ? napi : js;
4646
bench.start();
47-
for (var i = 0; i < n; i++) {
47+
for (let i = 0; i < n; i++) {
4848
fn();
4949
}
5050
bench.end(n);
Collapse file

‎benchmark/net/net-c2s-cork.js‎

Copy file name to clipboardExpand all lines: benchmark/net/net-c2s-cork.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ const bench = common.createBenchmark(main, {
1111
dur: [5],
1212
});
1313

14-
var chunk;
15-
var encoding;
14+
let chunk;
15+
let encoding;
1616

1717
function main({ dur, len, type }) {
1818
switch (type) {
Collapse file

‎benchmark/net/net-c2s.js‎

Copy file name to clipboardExpand all lines: benchmark/net/net-c2s.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ const bench = common.createBenchmark(main, {
1111
dur: [5],
1212
});
1313

14-
var chunk;
15-
var encoding;
14+
let chunk;
15+
let encoding;
1616

1717
function main({ dur, len, type }) {
1818
switch (type) {
Collapse file

‎benchmark/net/net-pipe.js‎

Copy file name to clipboardExpand all lines: benchmark/net/net-pipe.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ const bench = common.createBenchmark(main, {
1111
dur: [5],
1212
});
1313

14-
var chunk;
15-
var encoding;
14+
let chunk;
15+
let encoding;
1616

1717
function main({ dur, len, type }) {
1818
switch (type) {
Collapse file

‎benchmark/net/net-s2c.js‎

Copy file name to clipboardExpand all lines: benchmark/net/net-s2c.js
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ const bench = common.createBenchmark(main, {
1212
dur: [5]
1313
});
1414

15-
var chunk;
16-
var encoding;
17-
var recvbuf;
18-
var received = 0;
15+
let chunk;
16+
let encoding;
17+
let recvbuf;
18+
let received = 0;
1919

2020
function main({ dur, sendchunklen, type, recvbuflen, recvbufgenfn }) {
2121
if (isFinite(recvbuflen) && recvbuflen > 0)
@@ -38,8 +38,8 @@ function main({ dur, sendchunklen, type, recvbuflen, recvbufgenfn }) {
3838
}
3939

4040
const reader = new Reader();
41-
var writer;
42-
var socketOpts;
41+
let writer;
42+
let socketOpts;
4343
if (recvbuf === undefined) {
4444
writer = new Writer();
4545
socketOpts = { port: PORT };
Collapse file

‎benchmark/net/net-wrap-js-stream-passthrough.js‎

Copy file name to clipboardExpand all lines: benchmark/net/net-wrap-js-stream-passthrough.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ const bench = common.createBenchmark(main, {
1212
flags: ['--expose-internals']
1313
});
1414

15-
var chunk;
16-
var encoding;
15+
let chunk;
16+
let encoding;
1717

1818
function main({ dur, len, type }) {
1919
// Can only require internals inside main().
Collapse file

‎benchmark/net/tcp-raw-c2s.js‎

Copy file name to clipboardExpand all lines: benchmark/net/tcp-raw-c2s.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function main({ dur, len, type }) {
2424
const PORT = common.PORT;
2525

2626
const serverHandle = new TCP(TCPConstants.SERVER);
27-
var err = serverHandle.bind('127.0.0.1', PORT);
27+
let err = serverHandle.bind('127.0.0.1', PORT);
2828
if (err)
2929
fail(err, 'bind');
3030

@@ -38,7 +38,7 @@ function main({ dur, len, type }) {
3838

3939
// The meat of the benchmark is right here:
4040
bench.start();
41-
var bytes = 0;
41+
let bytes = 0;
4242

4343
setTimeout(() => {
4444
// report in Gb/sec
@@ -67,7 +67,7 @@ function main({ dur, len, type }) {
6767
}
6868

6969
function client(type, len) {
70-
var chunk;
70+
let chunk;
7171
switch (type) {
7272
case 'buf':
7373
chunk = Buffer.alloc(len, 'x');
@@ -102,7 +102,7 @@ function main({ dur, len, type }) {
102102
function write() {
103103
const writeReq = new WriteWrap();
104104
writeReq.oncomplete = afterWrite;
105-
var err;
105+
let err;
106106
switch (type) {
107107
case 'buf':
108108
err = clientHandle.writeBuffer(writeReq, chunk);

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.