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: fix buffer option in buffer read/write benchmarks · nodejs/node@cbd6913

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • benchmark/buffers
    • buffer-read-with-byteLength.js
    • buffer-read.js
    • buffer-write.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: benchmark/buffers/buffer-read-with-byteLength.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ const types = [
1010
];
1111

1212
const bench = common.createBenchmark(main, {
13-
buffer: ['fast'],
13+
buffer: ['fast', 'slow'],
1414
type: types,
1515
n: [1e6],
16-
byteLength: [1, 2, 3, 4, 5, 6],
16+
byteLength: [1, 2, 4, 6],
1717
});
1818

19-
function main({ n, buf, type, byteLength }) {
20-
const buff = buf === 'fast' ?
19+
function main({ n, buffer, type, byteLength }) {
20+
const buff = buffer === 'fast' ?
2121
Buffer.alloc(8) :
2222
Buffer.allocUnsafeSlow(8);
2323
const fn = `read${type}`;
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
@@ -20,13 +20,13 @@ const types = [
2020
];
2121

2222
const bench = common.createBenchmark(main, {
23-
buffer: ['fast'],
23+
buffer: ['fast', 'slow'],
2424
type: types,
2525
n: [1e6],
2626
});
2727

28-
function main({ n, buf, type }) {
29-
const buff = buf === 'fast' ?
28+
function main({ n, buffer, type }) {
29+
const buff = buffer === 'fast' ?
3030
Buffer.alloc(8) :
3131
Buffer.allocUnsafeSlow(8);
3232
const fn = `read${type}`;
Collapse file

‎benchmark/buffers/buffer-write.js‎

Copy file name to clipboardExpand all lines: benchmark/buffers/buffer-write.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const types = [
2727
];
2828

2929
const bench = common.createBenchmark(main, {
30-
buffer: ['fast'],
30+
buffer: ['fast', 'slow'],
3131
type: types,
3232
n: [1e6],
3333
});
@@ -70,8 +70,8 @@ const byteLength = {
7070
writeIntBE: 6,
7171
};
7272

73-
function main({ n, buf, type }) {
74-
const buff = buf === 'fast' ?
73+
function main({ n, buffer, type }) {
74+
const buff = buffer === 'fast' ?
7575
Buffer.alloc(8) :
7676
Buffer.allocUnsafeSlow(8);
7777
const fn = `write${type}`;

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.