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],
});
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

View File

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

View File

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