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: refactor for consistent style · moander/node@29e74d4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • benchmark
    • _cli.js
    • buffers
      • buffer-bytelength.js
      • buffer-fill.js
      • buffer-from.js
      • buffer-indexof.js
      • buffer-normalize-encoding.js
      • buffer-read-with-byteLength.js
      • buffer-read.js
      • buffer-write-string.js
      • buffer-write.js
      • dataview-set.js
    • child_process
      • child-process-read-ipc.js
      • child-process-read.js
      • spawn-echo.js
    • cluster
      • echo.js
    • compare.js
    • crypto
      • cipher-stream.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
    • es
      • map-bench.js
    • events
      • ee-add-remove.js
      • ee-emit.js
      • ee-listener-count-on-prototype.js
      • ee-listeners-many.js
      • ee-listeners.js
    • fixtures
      • simple-http-server.js
    • fs
      • bench-readdir.js
      • bench-realpath.js
      • bench-stat.js
      • read-stream-throughput.js
      • readfile-partitioned.js
      • readfile.js
      • write-stream-throughput.js
    • http
      • _chunky_http_client.js
      • check_invalid_header_char.js
      • check_is_http_token.js
      • chunked.js
      • client-request-body.js
      • cluster.js
      • end-vs-write-end.js
      • headers.js
      • http_server_for_chunky_client.js
      • set-header.js
      • set_header.js
      • simple.js
      • upgrade.js
    • misc
      • arguments.js
      • punycode.js
      • startup.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
      • 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
    • querystring
      • querystring-unescapebuffer.js
    • run.js
    • scatter.js
    • string_decoder
      • string-decoder-create.js
      • string-decoder.js
    • timers
      • set-immediate-breadth-args.js
      • set-immediate-breadth.js
      • set-immediate-depth-args.js
    • tls
      • throughput.js
      • tls-connect.js
    • util
      • inspect.js
      • normalize-encoding.js
    • v8
      • get-stats.js
    • zlib
      • creation.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/_cli.js‎

Copy file name to clipboardExpand all lines: benchmark/_cli.js
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ const path = require('path');
66
// Create an object of all benchmark scripts
77
const benchmarks = {};
88
fs.readdirSync(__dirname)
9-
.filter(function(name) {
10-
return fs.statSync(path.resolve(__dirname, name)).isDirectory();
11-
})
12-
.forEach(function(category) {
9+
.filter((name) => fs.statSync(path.resolve(__dirname, name)).isDirectory())
10+
.forEach((category) => {
1311
benchmarks[category] = fs.readdirSync(path.resolve(__dirname, category))
1412
.filter((filename) => filename[0] !== '.' && filename[0] !== '_');
1513
});
Collapse file

‎benchmark/buffers/buffer-bytelength.js‎

Copy file name to clipboardExpand all lines: benchmark/buffers/buffer-bytelength.js
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const chars = [
1212
'hello brendan!!!', // 1 byte
1313
'ΰαβγδεζηθικλμνξο', // 2 bytes
1414
'挰挱挲挳挴挵挶挷挸挹挺挻挼挽挾挿', // 3 bytes
15-
'𠜎𠜱𠝹𠱓𠱸𠲖𠳏𠳕𠴕𠵼𠵿𠸎𠸏𠹷𠺝𠺢' // 4 bytes
15+
'𠜎𠜱𠝹𠱓𠱸𠲖𠳏𠳕𠴕𠵼𠵿𠸎𠸏𠹷𠺝𠺢', // 4 bytes
1616
];
1717

1818
function main({ n, len, encoding }) {
@@ -33,9 +33,7 @@ function main({ n, len, encoding }) {
3333
}
3434

3535
// Check the result to ensure it is *properly* optimized
36-
results = strings.map(function(val) {
37-
return Buffer.byteLength(val, encoding);
38-
});
36+
results = strings.map((val) => Buffer.byteLength(val, encoding));
3937
}
4038

4139
bench.start();
Collapse file

‎benchmark/buffers/buffer-fill.js‎

Copy file name to clipboardExpand all lines: benchmark/buffers/buffer-fill.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const bench = common.createBenchmark(main, {
1212
'fill("t", "utf8")',
1313
'fill("t", 0, "utf8")',
1414
'fill("t", 0)',
15-
'fill(Buffer.alloc(1), 0)'
15+
'fill(Buffer.alloc(1), 0)',
1616
],
1717
size: [2 ** 8, 2 ** 13, 2 ** 16],
1818
n: [2e4]
Collapse file

‎benchmark/buffers/buffer-from.js‎

Copy file name to clipboardExpand all lines: benchmark/buffers/buffer-from.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const bench = common.createBenchmark(main, {
1212
'string',
1313
'string-utf8',
1414
'string-base64',
15-
'object'
15+
'object',
1616
],
1717
len: [10, 2048],
1818
n: [2048]
Collapse file

‎benchmark/buffers/buffer-indexof.js‎

Copy file name to clipboardExpand all lines: benchmark/buffers/buffer-indexof.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const searchStrings = [
1818
'Soo--oop',
1919
'aaaaaaaaaaaaaaaaa',
2020
'venture to go near the house till she had brought herself down to',
21-
'</i> to the Caterpillar'
21+
'</i> to the Caterpillar',
2222
];
2323

2424
const bench = common.createBenchmark(main, {
Collapse file

‎benchmark/buffers/buffer-normalize-encoding.js‎

Copy file name to clipboardExpand all lines: benchmark/buffers/buffer-normalize-encoding.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const bench = common.createBenchmark(main, {
2525
'utf16le',
2626
'UTF16LE',
2727
'utf8',
28-
'UTF8'
28+
'UTF8',
2929
],
3030
n: [1e6]
3131
}, {
Collapse file

‎benchmark/buffers/buffer-read-with-byteLength.js‎

Copy file name to clipboardExpand all lines: benchmark/buffers/buffer-read-with-byteLength.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const types = [
55
'IntBE',
66
'IntLE',
77
'UIntBE',
8-
'UIntLE'
8+
'UIntLE',
99
];
1010

1111
const bench = common.createBenchmark(main, {
Collapse file

‎benchmark/buffers/buffer-read.js‎

Copy file name to clipboardExpand all lines: benchmark/buffers/buffer-read.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const types = [
1515
'FloatLE',
1616
'FloatBE',
1717
'DoubleLE',
18-
'DoubleBE'
18+
'DoubleBE',
1919
];
2020

2121
const bench = common.createBenchmark(main, {
Collapse file

‎benchmark/buffers/buffer-write-string.js‎

Copy file name to clipboardExpand all lines: benchmark/buffers/buffer-write-string.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const common = require('../common.js');
44
const bench = common.createBenchmark(main, {
55
encoding: [
6-
'', 'utf8', 'ascii', 'hex', 'UCS-2', 'utf16le', 'latin1', 'binary'
6+
'', 'utf8', 'ascii', 'hex', 'UCS-2', 'utf16le', 'latin1', 'binary',
77
],
88
args: [ '', 'offset', 'offset+length' ],
99
len: [10, 2048],
Collapse file

‎benchmark/buffers/buffer-write.js‎

Copy file name to clipboardExpand all lines: benchmark/buffers/buffer-write.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const types = [
1919
'FloatLE',
2020
'FloatBE',
2121
'DoubleLE',
22-
'DoubleBE'
22+
'DoubleBE',
2323
];
2424

2525
const bench = common.createBenchmark(main, {

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.