benchmark: (querystring) use destructuring
PR-URL: https://github.com/nodejs/node/pull/18250 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
592454e703
commit
8d6df4f00e
@ -8,9 +8,7 @@ const bench = common.createBenchmark(main, {
|
|||||||
n: [1e6],
|
n: [1e6],
|
||||||
});
|
});
|
||||||
|
|
||||||
function main(conf) {
|
function main({ type, n }) {
|
||||||
const type = conf.type;
|
|
||||||
const n = conf.n | 0;
|
|
||||||
const input = inputs[type];
|
const input = inputs[type];
|
||||||
var i;
|
var i;
|
||||||
// Execute the function a "sufficient" number of times before the timed
|
// Execute the function a "sufficient" number of times before the timed
|
||||||
|
@ -7,10 +7,7 @@ const bench = common.createBenchmark(main, {
|
|||||||
n: [1e7],
|
n: [1e7],
|
||||||
});
|
});
|
||||||
|
|
||||||
function main(conf) {
|
function main({ type, n }) {
|
||||||
const type = conf.type;
|
|
||||||
const n = conf.n | 0;
|
|
||||||
|
|
||||||
const inputs = {
|
const inputs = {
|
||||||
noencode: {
|
noencode: {
|
||||||
foo: 'bar',
|
foo: 'bar',
|
||||||
|
@ -12,10 +12,7 @@ const bench = common.createBenchmark(main, {
|
|||||||
n: [10e6],
|
n: [10e6],
|
||||||
});
|
});
|
||||||
|
|
||||||
function main(conf) {
|
function main({ input, n }) {
|
||||||
const input = conf.input;
|
|
||||||
const n = conf.n | 0;
|
|
||||||
|
|
||||||
bench.start();
|
bench.start();
|
||||||
for (var i = 0; i < n; i += 1)
|
for (var i = 0; i < n; i += 1)
|
||||||
querystring.unescapeBuffer(input);
|
querystring.unescapeBuffer(input);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user