Skip to content

Commit

Permalink
benchmark: (querystring) use destructuring
Browse files Browse the repository at this point in the history
PR-URL: #18250
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
BridgeAR authored and evanlucas committed Jan 30, 2018
1 parent 81abea5 commit f491828
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
4 changes: 1 addition & 3 deletions benchmark/querystring/querystring-parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions benchmark/querystring/querystring-stringify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
5 changes: 1 addition & 4 deletions benchmark/querystring/querystring-unescapebuffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f491828

Please sign in to comment.