Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

benchmark: add trailing commas in benchmark/buffers #46473

Merged
merged 1 commit into from
Feb 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions benchmark/.eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ rules:

overrides:
- files:
- buffers/*.js
- buffers-fill/*.js
- crypto/*.js
- http/*.js
- http2/*.js
Expand Down
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-base64-decode.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const common = require('../common.js');

const bench = common.createBenchmark(main, {
n: [32],
size: [8 << 20]
size: [8 << 20],
});

function main({ n, size }) {
Expand Down
4 changes: 2 additions & 2 deletions benchmark/buffers/buffer-base64-encode.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ const common = require('../common.js');

const bench = common.createBenchmark(main, {
len: [64 * 1024 * 1024],
n: [32]
n: [32],
}, {
test: { len: 256 }
test: { len: 256 },
});

function main({ n, len }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-bytelength.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const common = require('../common');
const bench = common.createBenchmark(main, {
encoding: ['utf8', 'base64', 'buffer'],
len: [2, 16, 256], // x16
n: [4e6]
n: [4e6],
});

// 16 chars each
Expand Down
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-compare-instance-method.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const common = require('../common.js');
const bench = common.createBenchmark(main, {
size: [16, 512, 4096, 16386],
args: [1, 2, 5],
n: [1e6]
n: [1e6],
});

function main({ n, size, args }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-compare-offset.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const common = require('../common.js');
const bench = common.createBenchmark(main, {
method: ['offset', 'slice'],
size: [16, 512, 4096, 16386],
n: [1e6]
n: [1e6],
});

function compareUsingSlice(b0, b1, len, iter) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-compare.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const common = require('../common.js');

const bench = common.createBenchmark(main, {
size: [16, 512, 4096, 16386],
n: [1e6]
n: [1e6],
});

function main({ n, size }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-concat-fill.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const common = require('../common.js');

const bench = common.createBenchmark(main, {
extraSize: [1, 256, 4 * 256],
n: [8e5]
n: [8e5],
});

function main({ n, extraSize }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-concat.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const bench = common.createBenchmark(main, {
pieces: [4, 16],
pieceSize: [1, 16, 256],
withTotalLength: [0, 1],
n: [8e5]
n: [8e5],
});

function main({ n, pieces, pieceSize, withTotalLength }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const common = require('../common.js');
const bench = common.createBenchmark(main, {
bytes: [0, 8, 128, 32 * 1024],
partial: ['true', 'false'],
n: [6e6]
n: [6e6],
}, {
combinationFilter: (p) => {
return (p.partial === 'false' && p.bytes === 0) ||
Expand Down
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-creation.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const bench = common.createBenchmark(main, {
'slow-allocUnsafe',
],
len: [10, 1024, 4096, 8192],
n: [6e5]
n: [6e5],
});

function main({ len, n, type }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-equals.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const common = require('../common.js');
const bench = common.createBenchmark(main, {
size: [0, 512, 16386],
difflen: ['true', 'false'],
n: [1e6]
n: [1e6],
});

function main({ n, size, difflen }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-fill.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const bench = common.createBenchmark(main, {
'fill(Buffer.alloc(1), 0)',
],
size: [2 ** 13, 2 ** 16],
n: [2e4]
n: [2e4],
});

function main({ n, type, size }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-from.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const bench = common.createBenchmark(main, {
'uint16array',
],
len: [100, 2048],
n: [8e5]
n: [8e5],
});

function main({ len, n, source }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-hex.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const common = require('../common.js');

const bench = common.createBenchmark(main, {
len: [64, 1024],
n: [1e6]
n: [1e6],
});

function main({ len, n }) {
Expand Down
4 changes: 2 additions & 2 deletions benchmark/buffers/buffer-indexof-number.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ const path = require('path');

const bench = common.createBenchmark(main, {
value: ['@'.charCodeAt(0)],
n: [1e6]
n: [1e6],
});

function main({ n, value }) {
const aliceBuffer = fs.readFileSync(
path.resolve(__dirname, '../fixtures/alice.html')
path.resolve(__dirname, '../fixtures/alice.html'),
);

let count = 0;
Expand Down
4 changes: 2 additions & 2 deletions benchmark/buffers/buffer-indexof.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const bench = common.createBenchmark(main, {
search: searchStrings,
encoding: ['undefined', 'utf8', 'ucs2'],
type: ['buffer', 'string'],
n: [5e4]
n: [5e4],
}, {
combinationFilter: (p) => {
return (p.type === 'buffer' && p.encoding === 'undefined') ||
Expand All @@ -31,7 +31,7 @@ const bench = common.createBenchmark(main, {

function main({ n, search, encoding, type }) {
let aliceBuffer = fs.readFileSync(
path.resolve(__dirname, '../fixtures/alice.html')
path.resolve(__dirname, '../fixtures/alice.html'),
);

if (encoding === 'undefined') {
Expand Down
4 changes: 2 additions & 2 deletions benchmark/buffers/buffer-iterate.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ const bench = common.createBenchmark(main, {
size: [512, 4096, 16386],
type: ['fast'],
method: ['for', 'forOf', 'iterator'],
n: [1e3]
n: [1e3],
});

const methods = {
'for': benchFor,
'forOf': benchForOf,
'iterator': benchIterator
'iterator': benchIterator,
};

function main({ size, type, method, n }) {
Expand Down
4 changes: 2 additions & 2 deletions benchmark/buffers/buffer-normalize-encoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ const bench = common.createBenchmark(main, {
'utf8',
'UTF8',
],
n: [1e6]
n: [1e6],
}, {
flags: ['--expose-internals']
flags: ['--expose-internals'],
});

function main({ encoding, n }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-read-float.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const bench = common.createBenchmark(main, {
type: ['Double', 'Float'],
endian: ['LE'],
value: ['zero', 'big', 'small', 'inf', 'nan'],
n: [1e6]
n: [1e6],
});

function main({ n, type, endian, value }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-read-with-byteLength.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const bench = common.createBenchmark(main, {
buffer: ['fast'],
type: types,
n: [1e6],
byteLength: [1, 2, 3, 4, 5, 6]
byteLength: [1, 2, 3, 4, 5, 6],
});

function main({ n, buf, type, byteLength }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-read.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const types = [
const bench = common.createBenchmark(main, {
buffer: ['fast'],
type: types,
n: [1e6]
n: [1e6],
});

function main({ n, buf, type }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-slice.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const SlowBuffer = require('buffer').SlowBuffer;

const bench = common.createBenchmark(main, {
type: ['fast', 'slow', 'subarray'],
n: [1e6]
n: [1e6],
});

const buf = Buffer.allocUnsafe(1024);
Expand Down
4 changes: 2 additions & 2 deletions benchmark/buffers/buffer-swap.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ const bench = common.createBenchmark(main, {
aligned: ['true', 'false'],
method: ['swap16', 'swap32', 'swap64'/* , 'htons', 'htonl', 'htonll' */],
len: [64, 256, 768, 1024, 2056, 8192],
n: [1e6]
n: [1e6],
}, {
test: { len: 16 }
test: { len: 16 },
});

// The htons and htonl methods below are used to benchmark the
Expand Down
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-tojson.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const common = require('../common.js');

const bench = common.createBenchmark(main, {
n: [1e4],
len: [0, 256, 4 * 1024]
len: [0, 256, 4 * 1024],
});

function main({ n, len }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-tostring.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const bench = common.createBenchmark(main, {
encoding: ['', 'utf8', 'ascii', 'latin1', 'hex', 'UCS-2'],
args: [0, 1, 3],
len: [1, 64, 1024],
n: [1e6]
n: [1e6],
}, {
combinationFilter: (p) => {
return (p.args === 0 && p.encoding === '') ||
Expand Down
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-write-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const bench = common.createBenchmark(main, {
],
args: [ '', 'offset', 'offset+length' ],
len: [2048],
n: [1e6]
n: [1e6],
});

function main({ len, n, encoding, args }) {
Expand Down
6 changes: 3 additions & 3 deletions benchmark/buffers/buffer-write.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const types = [
const bench = common.createBenchmark(main, {
buffer: ['fast'],
type: types,
n: [1e6]
n: [1e6],
});

const INT8 = 0x7f;
Expand Down Expand Up @@ -60,14 +60,14 @@ const mod = {
writeUIntLE: INT8,
writeUIntBE: INT16,
writeIntLE: INT32,
writeIntBE: INT48
writeIntBE: INT48,
};

const byteLength = {
writeUIntLE: 1,
writeUIntBE: 2,
writeIntLE: 4,
writeIntBE: 6
writeIntBE: 6,
};

function main({ n, buf, type }) {
Expand Down
2 changes: 1 addition & 1 deletion benchmark/buffers/buffer-zero.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const common = require('../common.js');

const bench = common.createBenchmark(main, {
n: [1e6],
type: ['buffer', 'string']
type: ['buffer', 'string'],
});

const zeroBuffer = Buffer.alloc(0);
Expand Down
4 changes: 2 additions & 2 deletions benchmark/buffers/dataview-set.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const types = [

const bench = common.createBenchmark(main, {
type: types,
n: [1e6]
n: [1e6],
});

const INT8 = 0x7f;
Expand All @@ -36,7 +36,7 @@ const mod = {
setInt32: INT32,
setUint8: UINT8,
setUint16: UINT16,
setUint32: UINT32
setUint32: UINT32,
};

function main({ n, type }) {
Expand Down