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:
Ruben Bridgewater 2017-12-30 03:56:18 +01:00
parent 592454e703
commit 8d6df4f00e
No known key found for this signature in database
GPG Key ID: F07496B3EB3C1762
3 changed files with 3 additions and 11 deletions

View File

@ -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

View File

@ -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',

View File

@ -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);