Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f318a85

Browse filesBrowse files
mscdexruyadorno
authored andcommitted
benchmark: remove buffer benchmarks redundancy
PR-URL: #45735 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
1 parent 6186b3e commit f318a85
Copy full SHA for f318a85

File tree

Expand file treeCollapse file tree

3 files changed

+18
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+18
-2
lines changed
Open diff view settings
Collapse file

‎benchmark/buffers/buffer-copy.js‎

Copy file name to clipboardExpand all lines: benchmark/buffers/buffer-copy.js
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ const bench = common.createBenchmark(main, {
55
bytes: [0, 8, 128, 32 * 1024],
66
partial: ['true', 'false'],
77
n: [6e6]
8+
}, {
9+
combinationFilter: (p) => {
10+
return (p.partial === 'false' && p.bytes === 0) ||
11+
(p.partial !== 'false' && p.bytes !== 0);
12+
},
13+
test: { partial: 'false', bytes: 0 },
814
});
915

1016
function main({ n, bytes, partial }) {
Collapse file

‎benchmark/buffers/buffer-indexof.js‎

Copy file name to clipboardExpand all lines: benchmark/buffers/buffer-indexof.js
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,14 @@ const searchStrings = [
1919

2020
const bench = common.createBenchmark(main, {
2121
search: searchStrings,
22-
encoding: ['utf8', 'ucs2'],
22+
encoding: ['undefined', 'utf8', 'ucs2'],
2323
type: ['buffer', 'string'],
2424
n: [5e4]
25+
}, {
26+
combinationFilter: (p) => {
27+
return (p.type === 'buffer' && p.encoding === 'undefined') ||
28+
(p.type !== 'buffer' && p.encoding !== 'undefined');
29+
},
2530
});
2631

2732
function main({ n, search, encoding, type }) {
Collapse file

‎benchmark/buffers/buffer-tostring.js‎

Copy file name to clipboardExpand all lines: benchmark/buffers/buffer-tostring.js
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@
33
const common = require('../common.js');
44

55
const bench = common.createBenchmark(main, {
6-
encoding: ['utf8', 'ascii', 'latin1', 'hex', 'UCS-2'],
6+
encoding: ['', 'utf8', 'ascii', 'latin1', 'hex', 'UCS-2'],
77
args: [0, 1, 3],
88
len: [1, 64, 1024],
99
n: [1e6]
10+
}, {
11+
combinationFilter: (p) => {
12+
return (p.args === 0 && p.encoding === '') ||
13+
(p.args !== 0 && p.encoding !== '');
14+
},
1015
});
1116

1217
function main({ encoding, args, len, n }) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.