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: var to const · rbs392/node@e167ab7

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • benchmark
    • _benchmark_progress.js
    • arrays
      • var-int.js
      • zero-float.js
      • zero-int.js
    • buffers
      • buffer-base64-encode.js
      • buffer-bytelength.js
      • buffer-compare.js
      • buffer-indexof.js
      • buffer-iterate.js
      • buffer-read.js
      • buffer-slice.js
      • buffer-tojson.js
      • buffer-write.js
      • buffer_zero.js
      • dataview-set.js
    • child_process
      • child-process-exec-stdout.js
      • child-process-read.js
      • spawn-echo.js
    • cluster
      • echo.js
    • crypto
      • aes-gcm-throughput.js
      • cipher-stream.js
      • hash-stream-creation.js
      • hash-stream-throughput.js
      • rsa-encrypt-decrypt-throughput.js
      • rsa-sign-verify-throughput.js
    • dgram
      • array-vs-concat.js
      • multi-buffer.js
      • offset-length.js
      • single-buffer.js
    • domain
      • domain-fn-args.js
    • es
      • destructuring-object-bench.js
      • foreach-bench.js
      • restparams-bench.js
    • events
      • ee-add-remove.js
      • ee-emit-multi-args.js
      • ee-emit.js
      • ee-listener-count-on-prototype.js
      • ee-listeners-many.js
      • ee-listeners.js
      • ee-once.js
    • fixtures
      • simple-http-server.js
    • fs
      • read-stream-throughput.js
      • readFileSync.js
      • readfile.js
      • write-stream-throughput.js
    • http2
      • headers.js
      • respond-with-fd.js
      • simple.js
      • write.js
    • http
      • _chunky_http_client.js
      • check_invalid_header_char.js
      • check_is_http_token.js
      • chunked.js
      • client-request-body.js
      • cluster.js
      • create-clientrequest.js
      • end-vs-write-end.js
      • http_server_for_chunky_client.js
      • simple.js
    • misc
      • console.js
      • freelist.js
      • function_call
        • index.js
      • startup.js
      • util-extend-vs-object-assign.js
      • v8-bench.js
    • module
      • module-loader.js
    • net
      • net-c2s-cork.js
      • net-c2s.js
      • net-pipe.js
      • net-s2c.js
      • tcp-raw-c2s.js
      • tcp-raw-pipe.js
      • tcp-raw-s2c.js
    • path
      • basename-posix.js
      • basename-win32.js
      • dirname-posix.js
      • dirname-win32.js
      • extname-posix.js
      • extname-win32.js
      • format-posix.js
      • format-win32.js
      • isAbsolute-posix.js
      • isAbsolute-win32.js
      • join-posix.js
      • join-win32.js
      • makeLong-win32.js
      • normalize-posix.js
      • normalize-win32.js
      • parse-posix.js
      • parse-win32.js
      • relative-posix.js
      • relative-win32.js
      • resolve-posix.js
      • resolve-win32.js
    • process
      • memoryUsage.js
      • next-tick-breadth-args.js
      • next-tick-breadth.js
      • next-tick-depth-args.js
      • next-tick-depth.js
    • querystring
      • querystring-parse.js
      • querystring-stringify.js
      • querystring-unescapebuffer.js
    • streams
      • transform-creation.js
    • string_decoder
      • string-decoder.js
    • timers
      • immediate.js
      • timers-breadth.js
      • timers-cancel-pooled.js
      • timers-cancel-unpooled.js
      • timers-depth.js
      • timers-insert-pooled.js
      • timers-insert-unpooled.js
      • timers-timeout-pooled.js
    • tls
      • throughput.js
      • tls-connect.js
    • url
      • legacy-vs-whatwg-url-get-prop.js
      • legacy-vs-whatwg-url-serialize.js
      • url-searchparams-iteration.js
    • util
      • inspect.js
    • zlib
      • creation.js
      • deflate.js

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎benchmark/_benchmark_progress.js‎

Copy file name to clipboardExpand all lines: benchmark/_benchmark_progress.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
const readline = require('readline');
44

55
function pad(input, minLength, fill) {
6-
var result = String(input);
7-
var padding = fill.repeat(Math.max(0, minLength - result.length));
6+
const result = String(input);
7+
const padding = fill.repeat(Math.max(0, minLength - result.length));
88
return `${padding}${result}`;
99
}
1010

Collapse file

‎benchmark/arrays/var-int.js‎

Copy file name to clipboardExpand all lines: benchmark/arrays/var-int.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function main(conf) {
2323
const n = +conf.n;
2424

2525
bench.start();
26-
var arr = new clazz(n * 1e6);
26+
const arr = new clazz(n * 1e6);
2727
for (var i = 0; i < 10; ++i) {
2828
run();
2929
}
Collapse file

‎benchmark/arrays/zero-float.js‎

Copy file name to clipboardExpand all lines: benchmark/arrays/zero-float.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function main(conf) {
2323
const n = +conf.n;
2424

2525
bench.start();
26-
var arr = new clazz(n * 1e6);
26+
const arr = new clazz(n * 1e6);
2727
for (var i = 0; i < 10; ++i) {
2828
run();
2929
}
Collapse file

‎benchmark/arrays/zero-int.js‎

Copy file name to clipboardExpand all lines: benchmark/arrays/zero-int.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function main(conf) {
2323
const n = +conf.n;
2424

2525
bench.start();
26-
var arr = new clazz(n * 1e6);
26+
const arr = new clazz(n * 1e6);
2727
for (var i = 0; i < 10; ++i) {
2828
run();
2929
}
Collapse file

‎benchmark/buffers/buffer-base64-encode.js‎

Copy file name to clipboardExpand all lines: benchmark/buffers/buffer-base64-encode.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2121

2222
'use strict';
23-
var common = require('../common.js');
23+
const common = require('../common.js');
2424

2525
const bench = common.createBenchmark(main, {
2626
len: [64 * 1024 * 1024],
Collapse file

‎benchmark/buffers/buffer-bytelength.js‎

Copy file name to clipboardExpand all lines: benchmark/buffers/buffer-bytelength.js
+10-10Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
'use strict';
2-
var common = require('../common');
2+
const common = require('../common');
33

4-
var bench = common.createBenchmark(main, {
4+
const bench = common.createBenchmark(main, {
55
encoding: ['utf8', 'base64', 'buffer'],
66
len: [1, 2, 4, 16, 64, 256], // x16
77
n: [5e6]
88
});
99

1010
// 16 chars each
11-
var chars = [
11+
const chars = [
1212
'hello brendan!!!', // 1 byte
1313
'ΰαβγδεζηθικλμνξο', // 2 bytes
1414
'挰挱挲挳挴挵挶挷挸挹挺挻挼挽挾挿', // 3 bytes
1515
'𠜎𠜱𠝹𠱓𠱸𠲖𠳏𠳕𠴕𠵼𠵿𠸎𠸏𠹷𠺝𠺢' // 4 bytes
1616
];
1717

1818
function main(conf) {
19-
var n = conf.n | 0;
20-
var len = conf.len | 0;
21-
var encoding = conf.encoding;
19+
const n = conf.n | 0;
20+
const len = conf.len | 0;
21+
const encoding = conf.encoding;
2222

2323
var strings = [];
2424
var results;
2525
if (encoding === 'buffer') {
2626
strings = [ Buffer.alloc(len * 16, 'a') ];
2727
results = [ len * 16 ];
2828
} else {
29-
for (var string of chars) {
29+
for (const string of chars) {
3030
// Strings must be built differently, depending on encoding
31-
var data = string.repeat(len);
31+
const data = string.repeat(len);
3232
if (encoding === 'utf8') {
3333
strings.push(data);
3434
} else if (encoding === 'base64') {
@@ -45,9 +45,9 @@ function main(conf) {
4545

4646
bench.start();
4747
for (var i = 0; i < n; i++) {
48-
var index = n % strings.length;
48+
const index = n % strings.length;
4949
// Go!
50-
var r = Buffer.byteLength(strings[index], encoding);
50+
const r = Buffer.byteLength(strings[index], encoding);
5151

5252
if (r !== results[index])
5353
throw new Error('incorrect return value');
Collapse file

‎benchmark/buffers/buffer-compare.js‎

Copy file name to clipboardExpand all lines: benchmark/buffers/buffer-compare.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2121

2222
'use strict';
23-
var common = require('../common.js');
23+
const common = require('../common.js');
2424

25-
var bench = common.createBenchmark(main, {
25+
const bench = common.createBenchmark(main, {
2626
size: [16, 512, 1024, 4096, 16386],
2727
millions: [1]
2828
});
Collapse file

‎benchmark/buffers/buffer-indexof.js‎

Copy file name to clipboardExpand all lines: benchmark/buffers/buffer-indexof.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
2-
var common = require('../common.js');
3-
var fs = require('fs');
2+
const common = require('../common.js');
3+
const fs = require('fs');
44
const path = require('path');
55

66
const searchStrings = [
@@ -21,15 +21,15 @@ const searchStrings = [
2121
'</i> to the Caterpillar'
2222
];
2323

24-
var bench = common.createBenchmark(main, {
24+
const bench = common.createBenchmark(main, {
2525
search: searchStrings,
2626
encoding: ['undefined', 'utf8', 'ucs2', 'binary'],
2727
type: ['buffer', 'string'],
2828
iter: [1]
2929
});
3030

3131
function main(conf) {
32-
var iter = (conf.iter) * 100000;
32+
const iter = (conf.iter) * 100000;
3333
var aliceBuffer = fs.readFileSync(
3434
path.resolve(__dirname, '../fixtures/alice.html')
3535
);
Collapse file

‎benchmark/buffers/buffer-iterate.js‎

Copy file name to clipboardExpand all lines: benchmark/buffers/buffer-iterate.js
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
'use strict';
2-
var SlowBuffer = require('buffer').SlowBuffer;
3-
var common = require('../common.js');
4-
var assert = require('assert');
2+
const SlowBuffer = require('buffer').SlowBuffer;
3+
const common = require('../common.js');
4+
const assert = require('assert');
55

6-
var bench = common.createBenchmark(main, {
6+
const bench = common.createBenchmark(main, {
77
size: [16, 512, 1024, 4096, 16386],
88
type: ['fast', 'slow'],
99
method: ['for', 'forOf', 'iterator'],
1010
n: [1e3]
1111
});
1212

13-
var methods = {
13+
const methods = {
1414
'for': benchFor,
1515
'forOf': benchForOf,
1616
'iterator': benchIterator
@@ -43,7 +43,7 @@ function benchForOf(buffer, n) {
4343
bench.start();
4444

4545
for (var k = 0; k < n; k++) {
46-
for (var b of buffer) {
46+
for (const b of buffer) {
4747
assert(b === 0);
4848
}
4949
}
@@ -54,7 +54,7 @@ function benchIterator(buffer, n) {
5454
bench.start();
5555

5656
for (var k = 0; k < n; k++) {
57-
var iter = buffer[Symbol.iterator]();
57+
const iter = buffer[Symbol.iterator]();
5858
var cur = iter.next();
5959

6060
while (!cur.done) {
Collapse file

‎benchmark/buffers/buffer-read.js‎

Copy file name to clipboardExpand all lines: benchmark/buffers/buffer-read.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
2-
var common = require('../common.js');
2+
const common = require('../common.js');
33

4-
var types = [
4+
const types = [
55
'UInt8',
66
'UInt16LE',
77
'UInt16BE',
@@ -18,7 +18,7 @@ var types = [
1818
'DoubleBE'
1919
];
2020

21-
var bench = common.createBenchmark(main, {
21+
const bench = common.createBenchmark(main, {
2222
noAssert: ['false', 'true'],
2323
buffer: ['fast', 'slow'],
2424
type: types,

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.