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@d429651

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
@@ -9,14 +9,14 @@ const types = [
99
];
1010

1111
const bench = common.createBenchmark(main, {
12-
buffer: ['fast'],
12+
buffer: ['fast', 'slow'],
1313
type: types,
1414
n: [1e6],
15-
byteLength: [1, 2, 3, 4, 5, 6],
15+
byteLength: [1, 2, 4, 6],
1616
});
1717

18-
function main({ n, buf, type, byteLength }) {
19-
const buff = buf === 'fast' ?
18+
function main({ n, buffer, type, byteLength }) {
19+
const buff = buffer === 'fast' ?
2020
Buffer.alloc(8) :
2121
require('buffer').SlowBuffer(8);
2222
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
@@ -19,13 +19,13 @@ const types = [
1919
];
2020

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

27-
function main({ n, buf, type }) {
28-
const buff = buf === 'fast' ?
27+
function main({ n, buffer, type }) {
28+
const buff = buffer === 'fast' ?
2929
Buffer.alloc(8) :
3030
require('buffer').SlowBuffer(8);
3131
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
require('buffer').SlowBuffer(8);
7777
const fn = `write${type}`;

0 commit comments

Comments
0 (0)
You are visitor 01402775 — 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.