summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authorKhafra <maitken033380023@gmail.com>2023-03-22 15:44:44 -0400
committerGitHub <noreply@github.com>2023-03-22 19:44:44 +0000
commitf2651a0812ec2f7eb0c29f20669bd942e2e47258 (patch)
treee9d5b3d583486b2cd6cb7ea21f3cbd27bf94bd3d /benchmark
parent7bc0e6a4e79684a98cb64c61452af00e20f590e7 (diff)
downloadnode-new-f2651a0812ec2f7eb0c29f20669bd942e2e47258.tar.gz
url: implement URL.canParse
PR-URL: https://github.com/nodejs/node/pull/47179 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/url/whatwgurl-canParse.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/benchmark/url/whatwgurl-canParse.js b/benchmark/url/whatwgurl-canParse.js
new file mode 100644
index 0000000000..65741d9884
--- /dev/null
+++ b/benchmark/url/whatwgurl-canParse.js
@@ -0,0 +1,14 @@
+'use strict';
+const common = require('../common.js');
+
+const bench = common.createBenchmark(main, {
+ type: Object.keys(common.urls),
+ n: [25e6],
+});
+
+function main({ type, n }) {
+ bench.start();
+ for (let i = 0; i < n; i += 1)
+ URL.canParse(common.urls[type]);
+ bench.end(n);
+}