Skip to content

Commit

Permalink
benchmark: lower URL.canParse runs
Browse files Browse the repository at this point in the history
PR-URL: #47351
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
KhafraDev authored and danielleadams committed Jul 6, 2023
1 parent b2f2beb commit a72780e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions benchmark/url/whatwgurl-canParse.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';
const common = require('../common.js');

const bench = common.createBenchmark(main, {
type: Object.keys(common.urls),
n: [1e6],
});

function main({ type, n }) {
bench.start();
for (let i = 0; i < n; i += 1)
URL.canParse(common.urls[type]);
bench.end(n);
}

0 comments on commit a72780e

Please sign in to comment.