Browse Source

benchmark: simplify URLSearchParams import

PR-URL: https://github.com/nodejs/node/pull/11111
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
v6
Timothy Gu 8 years ago
parent
commit
590626ba11
  1. 2
      benchmark/url/url-searchparams-iteration.js
  2. 2
      benchmark/url/url-searchparams-parse.js
  3. 2
      benchmark/url/url-searchparams-read.js
  4. 2
      benchmark/url/url-searchparams-stringifier.js

2
benchmark/url/url-searchparams-iteration.js

@ -1,7 +1,7 @@
'use strict';
const common = require('../common.js');
const assert = require('assert');
const URLSearchParams = new (require('url').URL)('a:').searchParams.constructor;
const { URLSearchParams } = require('url');
const bench = common.createBenchmark(main, {
method: ['forEach', 'iterator'],

2
benchmark/url/url-searchparams-parse.js

@ -1,6 +1,6 @@
'use strict';
const common = require('../common.js');
const URLSearchParams = new (require('url').URL)('a:').searchParams.constructor;
const { URLSearchParams } = require('url');
const inputs = {
noencode: 'foo=bar&baz=quux&xyzzy=thud',

2
benchmark/url/url-searchparams-read.js

@ -1,6 +1,6 @@
'use strict';
const common = require('../common.js');
const URLSearchParams = new (require('url').URL)('a:').searchParams.constructor;
const { URLSearchParams } = require('url');
const bench = common.createBenchmark(main, {
method: ['get', 'getAll', 'has'],

2
benchmark/url/url-searchparams-stringifier.js

@ -1,7 +1,7 @@
'use strict';
const common = require('../common.js');
const Buffer = require('buffer').Buffer;
const URLSearchParams = new (require('url').URL)('a:').searchParams.constructor;
const { URLSearchParams } = require('url');
const inputs = {
noencode: 'foo=bar&baz=quux&xyzzy=thud',

Loading…
Cancel
Save