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

Performance of WHATWG URL API #30334

Closed
SukkaW opened this issue Nov 8, 2019 · 15 comments
Closed

Performance of WHATWG URL API #30334

SukkaW opened this issue Nov 8, 2019 · 15 comments
Labels
performance Issues and PRs related to the performance of Node.js. url Issues and PRs related to the legacy built-in url module. whatwg-url Issues and PRs related to the WHATWG URL implementation.

Comments

@SukkaW
Copy link

SukkaW commented Nov 8, 2019

  • Version:

    • 10.17.0
    • 12.13.0
    • 13.1.0
  • Subsystem: url

I have encountered performance regression when mitigating deprecated Legacy URL API to newer recommended WHATWG URL API for a performance-sensitive application. I have set up a benchmark: https://runkit.com/sukkaw/5dc5924f1ba0d60013d87cb3

const Benchmark = require('benchmark');
const Suite = new Benchmark.Suite;

// const { URL } = require('url') is only needed for Nodejs 8.
const { parse, URL } = require('url');

const safeWhatwgUrl = (str) => {
  // Handle relative path
  try {
    return new URL(str);
  } catch (e) {
    return str;
  }
};

Suite.add('Absolute URL - Legacy URL parse()', () => {
  parse('https://skk.moe/path/to/something');
}).add('Absolute URL - WHATWG URL API', () => {
  new URL('https://skk.moe/path/to/something');
}).add('Absolute URL - safe WHATWG URL', () => {
  // Should be very slow, since try...catch is very expensive
  safeWhatwgUrl('https://skk.moe/path/to/something');
}).add('Relative Path - Legacy URL parse()', () => {
  parse('/path/to/something');
}).add('Relative Path - WHATWG URL API', () => {
  // pass a `base` to handle relative path
  new URL('/path/to/something', 'https://skk.moe/');
}).add('Relative Path - safe WHATWG URL', () => {
  // Should be even slower.
  safeWhatwgUrl('/path/to/something');
}).on('cycle', function(event) {
  console.info(String(event.target));
}).run();

Resulted in:

Node.js 8.16.2

"Absolute URL - Legacy URL parse() x 214,035 ops/sec ±1.94% (84 runs sampled)"
"Absolute URL - WHATWG URL API x 182,604 ops/sec ±0.62% (88 runs sampled)"
"Absolute URL - safe WHATWG URL x 162,791 ops/sec ±3.63% (83 runs sampled)"
"Relative Path - Legacy URL parse() x 1,008,555 ops/sec ±3.55% (74 runs sampled)"
"Relative Path - WHATWG URL API x 70,292 ops/sec ±2.69% (80 runs sampled)"
"Relative Path - safe WHATWG URL x 55,500 ops/sec ±2.62% (85 runs sampled)"

On Node.js 8.16.2, The WHATWG URL API is 15% slower than Legacy URL API when handle a normal URL. It seems normal and acceptable.

Node.js 10.17.0

"Absolute URL - Legacy URL parse() x 483,508 ops/sec ±1.00% (93 runs sampled)"
"Absolute URL - WHATWG URL API x 286,201 ops/sec ±1.11% (93 runs sampled)"
"Absolute URL - safe WHATWG URL x 272,538 ops/sec ±1.00% (93 runs sampled)"
"Relative Path - Legacy URL parse() x 2,127,003 ops/sec ±0.46% (95 runs sampled)"
"Relative Path - WHATWG URL API x 169,296 ops/sec ±0.58% (96 runs sampled)"
"Relative Path - safe WHATWG URL x 96,357 ops/sec ±0.11% (98 runs sampled)"

On Node.js 10.17.0, The WHATWG URL API is 40% slower than Legacy URL API when handle a normal URL.

Node.js 12.13.0

"Absolute URL - Legacy URL parse() x 393,703 ops/sec ±1.21% (89 runs sampled)"
"Absolute URL - WHATWG URL API x 225,574 ops/sec ±0.59% (92 runs sampled)"
"Absolute URL - safe WHATWG URL x 208,342 ops/sec ±0.98% (90 runs sampled)"
"Relative Path - Legacy URL parse() x 1,513,601 ops/sec ±3.66% (84 runs sampled)"
"Relative Path - WHATWG URL API x 114,788 ops/sec ±1.29% (92 runs sampled)"
"Relative Path - safe WHATWG URL x 10,425 ops/sec ±0.99% (89 runs sampled)"

On Node.js 12.13.0, The WHATWG URL API is 42% slower than Legacy URL API when handle a normal URL.

Node.js 13.1.0

"Absolute URL - Legacy URL parse() x 345,345 ops/sec ±0.94% (87 runs sampled)"
"Absolute URL - WHATWG URL API x 212,058 ops/sec ±0.41% (91 runs sampled)"
"Absolute URL - safe WHATWG URL x 200,212 ops/sec ±0.76% (92 runs sampled)"
"Relative Path - Legacy URL parse() x 1,407,585 ops/sec ±1.72% (89 runs sampled)"
"Relative Path - WHATWG URL API x 108,171 ops/sec ±0.51% (90 runs sampled)"
"Relative Path - safe WHATWG URL x 10,279 ops/sec ±0.57% (90 runs sampled)"

On Node.js 13.1.0, The WHATWG URL API is 38% slower than Legacy URL API when handle a normal URL.

And when I try to pass a base to handle relative path, it becomes even more slower. I believe it is because I pass a string to base so The WHATWG URL have to parse base first.

@lpinca lpinca added url Issues and PRs related to the legacy built-in url module. whatwg-url Issues and PRs related to the WHATWG URL implementation. labels Nov 8, 2019
@joyeecheung joyeecheung added the performance Issues and PRs related to the performance of Node.js. label Nov 10, 2019
@joyeecheung
Copy link
Member

The last time I looked into the performance of the WHATWG URL parsing the bottleneck lies in the usage of std::string in the C++ layer (potentially fixable with something like zones, but that might be a bit over-engineering...).

I wonder what the performance drop from v8.x to v10.x could be from though..

@SukkaW
Copy link
Author

SukkaW commented Nov 22, 2019

benchmark run on repl.it (Node.js 10.16.0): https://repl.it/repls/PromotedLooseDemos

Absolute URL - Legacy URL parse() x 118,275 ops/sec ±9.76% (44 runs sampled)
Absolute URL - WHATWG URL API x 57,238 ops/sec ±4.40% (49 runs sampled)
Absolute URL - safe WHATWG URL x 52,917 ops/sec ±5.69% (48 runs sampled)
Relative Path - Legacy URL parse() x 960,842 ops/sec ±5.24% (49 runs sampled)
Relative Path - WHATWG URL API x 31,054 ops/sec ±5.15% (50 runs sampled)
Relative Path - safe WHATWG URL x 19,559 ops/sec ±7.28% (47 runs sampled)

And still, Legacy URL API is way faster (at least 2x) than The WHATWG URL API.

scottinet added a commit to kuzzleio/kuzzle that referenced this issue Dec 6, 2019
# Description

Fix a bug where an URL containing both a trailing slash and a querystring would be incorrectly parsed.

# How to reproduce

The following HTTP GET request works fine:

`http://localhost:7512/_now?pretty`

But not this one without this PR:

`http://localhost:7512/_now/?pretty`

Both requests are equivalent and should be regarded as identical.

# Other changes

~Use the WHATWG URL parsing API instead of the legacy (and deprecated) Node.js URL parser.
Unfortunately, the latter was much more adapted to URL parsing server-side than the former. 😑~

Reverted to the legacy URL API because of:
* nodejs/node#30334 (huge performance hit with WHATWG)
* nodejs/node#30776 (bug with relative URLs starting with double-slashes)
@Prinzhorn
Copy link

I'm seeing url.parse being roughly 15 times faster for "garbage" / "could be URL" (I'm throwing large amounts of data at it, extracting stuff I need in a fuzzy fashion). I know it's an odd use-case, but it's a use-case.

Reproducible here https://repl.it/repls/LimpingQuarrelsomeCoins

Garbage - Legacy URL parse() x 398,767 ops/sec ±36.51% (45 runs sampled)
Garbage - WHATWG URL API x 27,226 ops/sec ±6.81% (46 runs sampled)

@SukkaW
Copy link
Author

SukkaW commented Feb 15, 2020

@Prinzhorn

try { } catch (e) { } should be considered as very slow (which I have presented in my benchmark) and should be avoided.

@devsnek
Copy link
Member

devsnek commented Feb 15, 2020

@SukkaW it was slower in your benchmarks for two reasons: 1) you had an extra function call, and 2) the second one always threw, and throwing is a slower path than not throwing. I would argue it shouldn't have been throwing anyway because you should have passed a base to it like you did the other relative test.

Absolute URL - Legacy URL parse() x 813,426 ops/sec ±0.41% (97 runs sampled)
Absolute URL - WHATWG URL API x 541,469 ops/sec ±0.42% (99 runs sampled)
Absolute URL - safe WHATWG URL x 543,499 ops/sec ±0.17% (99 runs sampled)
Relative Path - Legacy URL parse() x 4,984,333 ops/sec ±0.46% (95 runs sampled)
Relative Path - WHATWG URL API x 268,401 ops/sec ±0.13% (90 runs sampled)
Relative Path - safe WHATWG URL x 271,700 ops/sec ±0.20% (96 runs sampled)
'use strict';

const Benchmark = require('benchmark');
const Suite = new Benchmark.Suite;

// const { URL } = require('url') is only needed for Nodejs 8.
const { parse, URL } = require('url');

Suite.add('Absolute URL - Legacy URL parse()', () => {
  return parse('https://skk.moe/path/to/something');
}).add('Absolute URL - WHATWG URL API', () => {
  return new URL('https://skk.moe/path/to/something');
}).add('Absolute URL - safe WHATWG URL', () => {
  const str = 'https://skk.moe/path/to/something';
  try {
    return new URL(str);
  } catch {
    return str;
  }
}).add('Relative Path - Legacy URL parse()', () => {
  return parse('/path/to/something');
}).add('Relative Path - WHATWG URL API', () => {
  return new URL('/path/to/something', 'https://skk.moe/');
}).add('Relative Path - safe WHATWG URL', () => {
  const str = '/path/to/something';
  try {
    return new URL(str, 'https://skk.moe');
  } catch {
    return str;
  }
}).on('cycle', function(event) {
  console.info(String(event.target));
}).run();

@SukkaW
Copy link
Author

SukkaW commented Feb 15, 2020

@devsnek

As you can see, the WHATWG URL API just can not handle any relative path. There are always cases that no base could be given. And the code snippet I described below are widely used:

const safeWhatwgUrl = (str) => {
  // Handle relative path
  try {
    return new URL(str);
  } catch (e) {
    return str;
  }
};

See eggjs/egg#4048: https://github.com/eggjs/egg/blob/1181a675cae08c2d6952b8c15a3a9375947e220b/lib/core/utils.js#L66-L72

And even a base is given (no matter if there is a try..catch block) when parsing a relative path, the WHATWG URL is still a kind of 3x slower than the Legacy URL API.

@devsnek
Copy link
Member

devsnek commented Feb 15, 2020

@SukkaW right... I agree that the whatwg parser is slower. My point was that your comparison was not really apples to apples (you were comparing a parse that always passed to a parse that always failed), and that try/catch isn't really slow.

@SukkaW
Copy link
Author

SukkaW commented Feb 15, 2020

@devsnek we both agree that try catch could be as fast as code without them when there is no exception thrown (which is also presented in the first part of my benchmark).

However in the specific case related to this issue, people are using try catch to handle relative path directly (as I mentioned code from eggjs, no base is given).

So in the second part of my benchmark I setup a case when only relative path to be parsed (and try catch for no given base).

Adding a case that has base passed is only to show that even with no exception to be catched by try catch, implementations with the WHATWG URL API is still not fast enough. This is what I thought when setting up my benchmark.

@Prinzhorn
Copy link

try { } catch (e) { } should be considered as very slow (which I have presented in my benchmark) and should be avoided.

@SukkaW thanks, I didn't know try/catch was that slow. However, once url.parse will disappear we have to use try/catch in order to safely replace it with the new API. So you cannot have a real world comparison without try/catch, it is a part of the new API if you will. But I think we already agree on that 👍

@jasnell
Copy link
Member

jasnell commented Feb 17, 2020

Unfortunately there's not a lot we can do here. The existing url.parse() uses a number of performance optimization tricks that make it faster but have had the side effect of making it largely unmaintainable. It has a number of security and parsing bugs that cannot be fixed properly without severe impact on it's performance and backwards compatibility. The WHATWG URL parser can, I'm sure, be made faster but a significant reason it is slower is because it takes a much stricter approach to spec compliance and favors parsing correctness over performance.

@SukkaW
Copy link
Author

SukkaW commented Feb 17, 2020

@jasnell

According to my benchmark, the WHATWG URL API is only 15% slower than the Legacy URL API for Node.js 8. But for Node.js 10 it becomes nearly 40% slower. There is space for performance improvement, right?

@jasnell
Copy link
Member

jasnell commented Feb 17, 2020

For sure yes! Just need to make certain we do not sacrifice spec compliance at all

@himself65
Copy link
Member

C:\Users\Himself65\Desktop\github\node>node benchmark/compare.js --old node --new ./Release/node.exe --filter legacy-vs-whatwg-url-parse url >  compare-12-6-3-vs-master.csv
[00:03:30|% 100| 1/1 files | 60/60 runs | 40/40 configs]: Done

C:\Users\Himself65\Desktop\github\node>cat compare-12-6-3-vs-master.csv | Rscript benchmark/compare.R
                                                                                           confidence improvement accuracy (*)    (**)    (***)
 url\\legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='auth' withBase='false'              ***     -8.23 %      ?±4.44% ?±5.92%  ?±7.70%
 url\\legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='auth' withBase='true'                **     -6.77 %      ?±4.90% ?±6.52%  ?±8.49%
 url\\legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='dot' withBase='false'               ***     -6.90 %      ?±3.12% ?±4.15%  ?±5.40%
 url\\legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='dot' withBase='true'                ***     -9.36 %      ?±4.93% ?±6.58%  ?±8.61%
 url\\legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='file' withBase='false'               **     -6.48 %      ?±3.79% ?±5.05%  ?±6.58%
 url\\legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='file' withBase='true'               ***     -9.01 %      ?±3.50% ?±4.65%  ?±6.05%
 url\\legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='idn' withBase='false'               ***    -10.69 %      ?±5.55% ?±7.39%  ?±9.62%
 url\\legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='idn' withBase='true'                ***    -11.18 %      ?±3.30% ?±4.39%  ?±5.71%
 url\\legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='javascript' withBase='false'         **     -6.08 %      ?±3.83% ?±5.10%  ?±6.64%
 url\\legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='javascript' withBase='true'          **     -7.69 %      ?±4.90% ?±6.53%  ?±8.52%
 url\\legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='long' withBase='false'              ***    -11.66 %      ?±5.12% ?±6.81%  ?±8.88%
 url\\legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='long' withBase='true'               ***    -14.55 %      ?±4.39% ?±5.85%  ?±7.62%
 url\\legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='percent' withBase='false'           ***     -8.77 %      ?±3.33% ?±4.43%  ?±5.76%
 url\\legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='percent' withBase='true'            ***    -11.25 %      ?±4.28% ?±5.70%  ?±7.42%
 url\\legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='short' withBase='false'              **     -7.81 %      ?±5.29% ?±7.04%  ?±9.18%
 url\\legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='short' withBase='true'              ***     -7.96 %      ?±4.17% ?±5.55%  ?±7.23%
 url\\legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='wpt' withBase='false'               ***     -8.19 %      ?±3.87% ?±5.15%  ?±6.70%
 url\\legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='wpt' withBase='true'                ***     -9.38 %      ?±3.60% ?±4.79%  ?±6.24%
 url\\legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='ws' withBase='false'                        -1.54 %      ?±4.23% ?±5.63%  ?±7.35%
 url\\legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='ws' withBase='true'                   *     -6.93 %      ?±6.47% ?±8.65% ?±11.33%
 url\\legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='auth' withBase='false'              ***    -16.04 %      ?±3.35% ?±4.46%  ?±5.82%
 url\\legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='auth' withBase='true'               ***    -17.67 %      ?±3.71% ?±4.95%  ?±6.46%
 url\\legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='dot' withBase='false'               ***    -14.78 %      ?±5.06% ?±6.76%  ?±8.86%
 url\\legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='dot' withBase='true'                ***    -16.43 %      ?±4.48% ?±5.96%  ?±7.77%
 url\\legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='file' withBase='false'              ***     -9.65 %      ?±4.20% ?±5.60%  ?±7.33%
 url\\legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='file' withBase='true'               ***    -15.20 %      ?±3.90% ?±5.20%  ?±6.80%
 url\\legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='idn' withBase='false'               ***    -18.98 %      ?±3.26% ?±4.34%  ?±5.65%
 url\\legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='idn' withBase='true'                ***    -14.30 %      ?±3.14% ?±4.18%  ?±5.45%
 url\\legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='javascript' withBase='false'        ***    -15.15 %      ?±4.37% ?±5.82%  ?±7.59%
 url\\legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='javascript' withBase='true'         ***    -16.06 %      ?±3.90% ?±5.19%  ?±6.76%
 url\\legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='long' withBase='false'              ***    -13.63 %      ?±4.67% ?±6.23%  ?±8.12%
 url\\legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='long' withBase='true'               ***    -23.90 %      ?±3.82% ?±5.09%  ?±6.65%
 url\\legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='percent' withBase='false'           ***    -18.69 %      ?±3.43% ?±4.57%  ?±5.94%
 url\\legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='percent' withBase='true'            ***    -15.60 %      ?±4.03% ?±5.36%  ?±6.98%
 url\\legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='short' withBase='false'             ***    -16.93 %      ?±3.44% ?±4.57%  ?±5.96%
 url\\legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='short' withBase='true'              ***    -14.26 %      ?±4.01% ?±5.36%  ?±7.02%
 url\\legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='wpt' withBase='false'               ***    -15.15 %      ?±3.69% ?±4.94%  ?±6.47%
 url\\legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='wpt' withBase='true'                ***    -14.99 %      ?±4.73% ?±6.29%  ?±8.20%
 url\\legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='ws' withBase='false'                ***    -19.27 %      ?±5.87% ?±7.85% ?±10.29%
 url\\legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='ws' withBase='true'                 ***    -17.64 %      ?±5.16% ?±6.88%  ?±8.98%

@watilde
Copy link
Member

watilde commented Sep 22, 2020

I'm also sharing benchmark results that I ran. It's fair to say that legacy URL is faster than WHATWG's URL as legacy one has less processing and the newer version of WHATWG's URL should have more logics within WHATWG's URL itself just because some updates in the module are major-update so that it should be slower. However, a few cases have more than about 5% deteriorate. It seems to be worth tracking for a while to figure out why this happens.


Refs:

v12.18.3 vs v14.11.0
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='auth' withBase='false'                       0.39 %       ±6.76%  ±9.03% ±11.83%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='auth' withBase='true'                       -1.80 %       ±6.04%  ±8.04% ±10.46%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='dot' withBase='false'                       -0.33 %       ±7.71% ±10.31% ±13.51%*url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='dot' withBase='true'                        -5.32 %       ±6.91%  ±9.21% ±12.02%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='file' withBase='false'                      -0.39 %       ±5.66%  ±7.55%  ±9.85%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='file' withBase='true'                       -2.46 %       ±5.79%  ±7.71% ±10.04%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='idn' withBase='false'                        2.69 %       ±7.32%  ±9.78% ±12.81%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='idn' withBase='true'                        -5.04 %       ±8.37% ±11.16% ±14.57%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='javascript' withBase='false'                -0.66 %       ±7.72% ±10.27% ±13.38%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='javascript' withBase='true'                 -0.86 %       ±6.81%  ±9.06% ±11.80%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='long' withBase='false'                       0.00 %       ±6.24%  ±8.31% ±10.82%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='long' withBase='true'                       -0.19 %       ±6.55%  ±8.71% ±11.34%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='percent' withBase='false'                   -2.66 %       ±8.26% ±11.00% ±14.36%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='percent' withBase='true'                    -5.70 %       ±8.42% ±11.21% ±14.61%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='short' withBase='false'                     -2.10 %       ±7.30%  ±9.73% ±12.70%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='short' withBase='true'                      -3.24 %       ±6.81%  ±9.06% ±11.79%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='wpt' withBase='false'                       -2.15 %       ±6.97%  ±9.27% ±12.07%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='wpt' withBase='true'                        -1.01 %       ±7.82% ±10.42% ±13.61%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='ws' withBase='false'                         0.89 %       ±7.06%  ±9.41% ±12.28%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='ws' withBase='true'                         -0.14 %       ±6.49%  ±8.64% ±11.24%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='auth' withBase='false'                      -0.30 %       ±5.29%  ±7.05%  ±9.20%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='auth' withBase='true'                       -3.06 %       ±6.17%  ±8.21% ±10.69%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='dot' withBase='false'                       -4.09 %       ±5.24%  ±6.97%  ±9.09%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='dot' withBase='true'                         0.61 %       ±6.51%  ±8.69% ±11.35%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='file' withBase='false'                      -2.25 %       ±4.64%  ±6.20%  ±8.10%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='file' withBase='true'                       -2.14 %       ±6.71%  ±8.94% ±11.64%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='idn' withBase='false'                        0.83 %       ±6.22%  ±8.30% ±10.85%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='idn' withBase='true'                  *     -5.35 %       ±4.49%  ±5.98%  ±7.78%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='javascript' withBase='false'                -2.13 %       ±5.85%  ±7.83% ±10.30%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='javascript' withBase='true'                 -4.13 %       ±7.44%  ±9.91% ±12.92%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='long' withBase='false'                       2.67 %       ±8.48% ±11.33% ±14.86%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='long' withBase='true'                       -5.31 %       ±7.15%  ±9.51% ±12.38%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='percent' withBase='false'                   -3.97 %       ±6.18%  ±8.22% ±10.72%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='percent' withBase='true'              *     -5.84 %       ±4.64%  ±6.18%  ±8.05%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='short' withBase='false'                     -3.01 %       ±6.79%  ±9.04% ±11.77%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='short' withBase='true'                      -3.56 %       ±5.02%  ±6.68%  ±8.69%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='wpt' withBase='false'                       -3.57 %       ±6.81%  ±9.07% ±11.82%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='wpt' withBase='true'                         6.36 %       ±7.84% ±10.50% ±13.79%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='ws' withBase='false'                        -2.07 %       ±4.40%  ±5.88%  ±7.70%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='ws' withBase='true'                         -3.21 %       ±4.35%  ±5.79%  ±7.54%
v12.18.3 vs master
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='auth' withBase='false'               **    -11.80 %       ±8.01% ±10.67% ±13.91%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='auth' withBase='true'                 *    -10.00 %       ±8.36% ±11.16% ±14.61%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='dot' withBase='false'                       -6.94 %       ±8.77% ±11.67% ±15.20%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='dot' withBase='true'                        -3.29 %       ±7.80% ±10.38% ±13.51%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='file' withBase='false'                      -3.34 %       ±9.90% ±13.17% ±17.14%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='file' withBase='true'                       -3.71 %       ±9.99% ±13.30% ±17.31%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='idn' withBase='false'                       -0.93 %       ±8.58% ±11.49% ±15.09%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='idn' withBase='true'                        -1.82 %       ±7.92% ±10.56% ±13.79%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='javascript' withBase='false'                 0.38 %      ±10.75% ±14.34% ±18.72%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='javascript' withBase='true'                 -6.65 %       ±6.81%  ±9.06% ±11.80%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='long' withBase='false'              ***    -15.51 %       ±6.42%  ±8.54% ±11.12%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='long' withBase='true'                       -8.09 %       ±9.34% ±12.43% ±16.18%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='percent' withBase='false'             *    -10.65 %       ±9.79% ±13.03% ±16.98%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='percent' withBase='true'                    -6.73 %       ±8.08% ±10.76% ±14.00%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='short' withBase='false'                     -6.21 %       ±8.84% ±11.76% ±15.31%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='short' withBase='true'                      -2.04 %       ±5.42%  ±7.21%  ±9.39%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='wpt' withBase='false'               ***    -19.86 %       ±6.28%  ±8.36% ±10.89%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='wpt' withBase='true'                ***    -13.07 %       ±6.26%  ±8.39% ±11.05%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='ws' withBase='false'                ***    -16.84 %       ±5.86%  ±7.80% ±10.15%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='ws' withBase='true'                 ***    -13.42 %       ±6.35%  ±8.45% ±11.01%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='auth' withBase='false'              ***    -30.80 %       ±9.27% ±12.35% ±16.10%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='auth' withBase='true'               ***    -17.81 %      ±10.13% ±13.49% ±17.60%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='dot' withBase='false'                 *     10.43 %       ±9.10% ±12.13% ±15.84%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='dot' withBase='true'                ***    -24.49 %       ±9.82% ±13.08% ±17.04%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='file' withBase='false'                *     12.68 %      ±10.24% ±13.63% ±17.75%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='file' withBase='true'               ***    -20.19 %       ±6.38%  ±8.51% ±11.12%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='idn' withBase='false'                        5.20 %       ±8.54% ±11.38% ±14.83%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='idn' withBase='true'                 **    -14.95 %       ±8.73% ±11.71% ±15.41%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='javascript' withBase='false'         **     19.59 %      ±12.42% ±16.56% ±21.64%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='javascript' withBase='true'         ***    -24.85 %       ±7.77% ±10.35% ±13.49%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='long' withBase='false'                *    -10.62 %       ±9.04% ±12.03% ±15.67%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='long' withBase='true'                       -5.84 %       ±7.45%  ±9.91% ±12.91%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='percent' withBase='false'             *     12.88 %      ±10.33% ±13.77% ±18.00%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='percent' withBase='true'            ***    -19.93 %       ±6.18%  ±8.29% ±10.93%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='short' withBase='false'                      2.72 %       ±7.49% ±10.01% ±13.12%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='short' withBase='true'              ***    -24.21 %       ±8.99% ±11.96% ±15.57%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='wpt' withBase='false'               ***    -34.29 %       ±8.66% ±11.57% ±15.18%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='wpt' withBase='true'                        -4.14 %       ±8.10% ±10.77% ±14.02%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='ws' withBase='false'                         7.42 %       ±9.64% ±12.84% ±16.73%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='ws' withBase='true'                 ***    -21.68 %       ±4.65%  ±6.20%  ±8.09%
v14.11.0 vs master
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='auth' withBase='false'              ***    -10.39 %       ±2.25% ±2.99% ±3.90%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='auth' withBase='true'               ***     -8.91 %       ±3.38% ±4.51% ±5.91%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='dot' withBase='false'                       -1.98 %       ±2.21% ±2.94% ±3.83%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='dot' withBase='true'                        -0.27 %       ±2.53% ±3.37% ±4.39%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='file' withBase='false'               **     -3.57 %       ±2.19% ±2.91% ±3.79%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='file' withBase='true'                       -1.71 %       ±4.15% ±5.55% ±7.28%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='idn' withBase='false'               ***     -5.72 %       ±2.13% ±2.83% ±3.69%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='idn' withBase='true'                 **     -5.64 %       ±3.64% ±4.85% ±6.31%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='javascript' withBase='false'                -2.36 %       ±2.99% ±3.98% ±5.19%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='javascript' withBase='true'                 -1.82 %       ±2.73% ±3.65% ±4.77%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='long' withBase='false'              ***    -12.07 %       ±2.84% ±3.79% ±4.94%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='long' withBase='true'               ***    -12.99 %       ±4.46% ±5.93% ±7.73%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='percent' withBase='false'                   -2.70 %       ±3.11% ±4.14% ±5.39%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='percent' withBase='true'                     0.43 %       ±4.02% ±5.39% ±7.09%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='short' withBase='false'               *     -2.47 %       ±2.20% ±2.94% ±3.83%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='short' withBase='true'                      -3.15 %       ±3.97% ±5.28% ±6.88%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='wpt' withBase='false'               ***    -17.45 %       ±2.86% ±3.81% ±4.96%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='wpt' withBase='true'                ***    -16.23 %       ±2.03% ±2.70% ±3.53%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='ws' withBase='false'                ***    -13.41 %       ±1.97% ±2.62% ±3.42%
url/legacy-vs-whatwg-url-parse.js method='legacy' e=1 type='ws' withBase='true'                 ***    -12.23 %       ±2.95% ±3.92% ±5.11%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='auth' withBase='false'              ***    -25.02 %       ±3.58% ±4.77% ±6.23%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='auth' withBase='true'               ***    -15.13 %       ±3.42% ±4.55% ±5.93%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='dot' withBase='false'               ***     13.54 %       ±2.55% ±3.39% ±4.42%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='dot' withBase='true'                ***    -20.92 %       ±2.55% ±3.39% ±4.42%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='file' withBase='false'              ***     19.16 %       ±2.29% ±3.04% ±3.96%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='file' withBase='true'               ***    -20.82 %       ±2.54% ±3.38% ±4.40%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='idn' withBase='false'               ***     12.49 %       ±4.37% ±5.81% ±7.58%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='idn' withBase='true'                ***    -16.95 %       ±3.02% ±4.03% ±5.25%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='javascript' withBase='false'        ***     14.20 %       ±2.58% ±3.43% ±4.46%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='javascript' withBase='true'         ***    -22.73 %       ±2.55% ±3.39% ±4.42%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='long' withBase='false'               **     -6.49 %       ±4.26% ±5.66% ±7.37%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='long' withBase='true'                       -1.43 %       ±3.55% ±4.73% ±6.16%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='percent' withBase='false'           ***     11.18 %       ±2.89% ±3.85% ±5.01%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='percent' withBase='true'            ***    -20.69 %       ±2.25% ±2.99% ±3.90%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='short' withBase='false'             ***     11.51 %       ±2.29% ±3.05% ±3.97%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='short' withBase='true'              ***    -22.92 %       ±2.75% ±3.67% ±4.79%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='wpt' withBase='false'               ***    -37.89 %       ±3.54% ±4.75% ±6.26%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='wpt' withBase='true'                ***     -5.58 %       ±2.74% ±3.65% ±4.75%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='ws' withBase='false'                ***     13.97 %       ±2.53% ±3.37% ±4.39%
url/legacy-vs-whatwg-url-parse.js method='whatwg' e=1 type='ws' withBase='true'                 ***    -19.01 %       ±2.16% ±2.88% ±3.75%

@SukkaW
Copy link
Author

SukkaW commented Feb 6, 2023

@anonrig Thanks for your hard work! I was not expecting this issue to get fixed after years.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Issues and PRs related to the performance of Node.js. url Issues and PRs related to the legacy built-in url module. whatwg-url Issues and PRs related to the WHATWG URL implementation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants