Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

benchmarks: fix benchmark for url #19084

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
benchmarks: fix benchmark for url
  • Loading branch information
daynin committed Mar 2, 2018
commit a4e954c937e5b69758629f218f2246acd94f563c
5 changes: 2 additions & 3 deletions benchmark/url/url-searchparams-read.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ const str = 'one=single&two=first&three=first&two=2nd&three=2nd&three=3rd';

function main({ method, param, n }) {
const params = new URLSearchParams(str);
const fn = params[method];
if (!fn)
if (!params[method])
throw new Error(`Unknown method ${method}`);

bench.start();
for (var i = 0; i < n; i += 1)
fn(param);
params[method](param);
bench.end(n);
}