mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
benchmark: remove buffer benchmarks redundancy
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
1 parent
6468f30d0d
commit
d0b9be21eb
3 files changed
+18
-2
No files matched your search
@@ -5,6 +5,12 @@ const bench = common.createBenchmark(main, {
|
||||
bytes: [0, 8, 128, 32 * 1024],
|
||||
partial: ['true', 'false'],
|
||||
n: [6e6]
|
||||
}, {
|
||||
combinationFilter: (p) => {
|
||||
return (p.partial === 'false' && p.bytes === 0) ||
|
||||
(p.partial !== 'false' && p.bytes !== 0);
|
||||
},
|
||||
test: { partial: 'false', bytes: 0 },
|
||||
});
|
||||
|
||||
function main({ n, bytes, partial }) {
|
||||
|
||||
@@ -19,9 +19,14 @@ const searchStrings = [
|
||||
|
||||
const bench = common.createBenchmark(main, {
|
||||
search: searchStrings,
|
||||
encoding: ['utf8', 'ucs2'],
|
||||
encoding: ['undefined', 'utf8', 'ucs2'],
|
||||
type: ['buffer', 'string'],
|
||||
n: [5e4]
|
||||
}, {
|
||||
combinationFilter: (p) => {
|
||||
return (p.type === 'buffer' && p.encoding === 'undefined') ||
|
||||
(p.type !== 'buffer' && p.encoding !== 'undefined');
|
||||
},
|
||||
});
|
||||
|
||||
function main({ n, search, encoding, type }) {
|
||||
|
||||
@@ -3,10 +3,15 @@
|
||||
const common = require('../common.js');
|
||||
|
||||
const bench = common.createBenchmark(main, {
|
||||
encoding: ['utf8', 'ascii', 'latin1', 'hex', 'UCS-2'],
|
||||
encoding: ['', 'utf8', 'ascii', 'latin1', 'hex', 'UCS-2'],
|
||||
args: [0, 1, 3],
|
||||
len: [1, 64, 1024],
|
||||
n: [1e6]
|
||||
}, {
|
||||
combinationFilter: (p) => {
|
||||
return (p.args === 0 && p.encoding === '') ||
|
||||
(p.args !== 0 && p.encoding !== '');
|
||||
},
|
||||
});
|
||||
|
||||
function main({ encoding, args, len, n }) {
|
||||
|
||||
Reference in new issue
Block a user