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],
|
||||
});
|
||||
|
||||
function main(conf) {
|
||||
const type = conf.type;
|
||||
const n = conf.n | 0;
|
||||
function main({ type, n }) {
|
||||
const input = inputs[type];
|
||||
var i;
|
||||
// Execute the function a "sufficient" number of times before the timed
|
||||
|
@ -7,10 +7,7 @@ const bench = common.createBenchmark(main, {
|
||||
n: [1e7],
|
||||
});
|
||||
|
||||
function main(conf) {
|
||||
const type = conf.type;
|
||||
const n = conf.n | 0;
|
||||
|
||||
function main({ type, n }) {
|
||||
const inputs = {
|
||||
noencode: {
|
||||
foo: 'bar',
|
||||
|
@ -12,10 +12,7 @@ const bench = common.createBenchmark(main, {
|
||||
n: [10e6],
|
||||
});
|
||||
|
||||
function main(conf) {
|
||||
const input = conf.input;
|
||||
const n = conf.n | 0;
|
||||
|
||||
function main({ input, n }) {
|
||||
bench.start();
|
||||
for (var i = 0; i < n; i += 1)
|
||||
querystring.unescapeBuffer(input);
|
||||
|
Loading…
x
Reference in New Issue
Block a user