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

benchmark: improve WHATWG URL benchmarks #10678

Closed

Conversation

joyeecheung
Copy link
Member

@joyeecheung joyeecheung commented Jan 7, 2017

Checklist
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

benchmark, url

This adds benchmark to compare the performance of WHATWG URL
implementation with that of the old URL API regarding properties
and stringifiers(url.format v.s. URL#toString).

The WHATWG URL implementation is still experimental but it might be helpful to start tracking the performance differences. The properties are kinda destined to be slower, because they need to invoke accessors and go through some code to match what the spec requires, but this can help us to see where we are at, and might be useful when we want to evangelise them(so people could see the performance improvments/hits before jumping in).

This is a first attempt and I think the current way to benchmark these properties could be too "micro". An alternative approach would be to test a set of operations in each benchmark cycle instead of doing only one thing in on cycle. And the setters could be benchmarked too(e.g. set and stringify in a cycle). I would like to see what we think about this.

@nodejs/url

@nodejs-github-bot nodejs-github-bot added benchmark Issues and PRs related to the benchmark subsystem. lts-watch-v6.x labels Jan 7, 2017
@joyeecheung joyeecheung 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 Jan 7, 2017
@joyeecheung
Copy link
Member Author

BTW, on Darwin Kernel Version 15.6.0: Wed Nov 2 20:30:56 PDT 2016; root:xnu-3248.60.11.1.2~2/RELEASE_X86_64 x86_64:

Results of `url.format(old)` v.s. `new.toString()`
url/new-url-properties.js n=100000 method="old" prop="stringifier" type="long": 1,931,178.2529862437
url/new-url-properties.js n=100000 method="new" prop="stringifier" type="long": 1,644,836.5873766062
url/new-url-properties.js n=100000 method="old" prop="stringifier" type="short": 2,211,006.4253615527
url/new-url-properties.js n=100000 method="new" prop="stringifier" type="short": 1,520,694.4232835593
url/new-url-properties.js n=100000 method="old" prop="stringifier" type="idn": 2,198,824.723787486
url/new-url-properties.js n=100000 method="new" prop="stringifier" type="idn": 5,876,998.649700791
url/new-url-properties.js n=100000 method="old" prop="stringifier" type="auth": 1,617,199.3157888448
url/new-url-properties.js n=100000 method="new" prop="stringifier" type="auth": 4,042,281.45556896
url/new-url-properties.js n=100000 method="old" prop="stringifier" type="special": 1,313,069.9158389152
url/new-url-properties.js n=100000 method="new" prop="stringifier" type="special": 1,736,090.9471381314
Results of `url.protocol`
url/new-url-properties.js n=100000 method="old" prop="protocol" type="long": 11,182,667.759586062
url/new-url-properties.js n=100000 method="new" prop="protocol" type="long": 6,225,058.524887721
url/new-url-properties.js n=100000 method="old" prop="protocol" type="short": 11,167,068.048315883
url/new-url-properties.js n=100000 method="new" prop="protocol" type="short": 5,045,771.708902972
url/new-url-properties.js n=100000 method="old" prop="protocol" type="idn": 10,646,324.521476991
url/new-url-properties.js n=100000 method="new" prop="protocol" type="idn": 5,635,780.578998681
url/new-url-properties.js n=100000 method="old" prop="protocol" type="auth": 9,157,233.266506897
url/new-url-properties.js n=100000 method="new" prop="protocol" type="auth": 6,366,295.507394388
url/new-url-properties.js n=100000 method="old" prop="protocol" type="special": 11,233,445.832548864
url/new-url-properties.js n=100000 method="new" prop="protocol" type="special": 6,336,287.96553262
Results of auth(`old.auth` v.s. `new.username + ':' + new.password`)
url/new-url-properties.js n=100000 method="old" prop="auth" type="long": 9,825,048.312218813
url/new-url-properties.js n=100000 method="new" prop="auth" type="long": 35,201,017.1685921
url/new-url-properties.js n=100000 method="old" prop="auth" type="short": 9,592,973.032138282
url/new-url-properties.js n=100000 method="new" prop="auth" type="short": 38,615,659.499471545
url/new-url-properties.js n=100000 method="old" prop="auth" type="idn": 10,031,574.380362188
url/new-url-properties.js n=100000 method="new" prop="auth" type="idn": 36,363,623.14050067
url/new-url-properties.js n=100000 method="old" prop="auth" type="auth": 8,806,970.75257855
url/new-url-properties.js n=100000 method="new" prop="auth" type="auth": 15,470,957.608957313
url/new-url-properties.js n=100000 method="old" prop="auth" type="special": 9,792,467.26206826
url/new-url-properties.js n=100000 method="new" prop="auth" type="special": 35,558,210.568611346
Results of `url.host`
url/new-url-properties.js n=100000 method="old" prop="host" type="long": 11,111,432.108038675
url/new-url-properties.js n=100000 method="new" prop="host" type="long": 4,903,943.27549966
url/new-url-properties.js n=100000 method="old" prop="host" type="short": 11,261,911.86495346
url/new-url-properties.js n=100000 method="new" prop="host" type="short": 6,436,216.642537291
url/new-url-properties.js n=100000 method="old" prop="host" type="idn": 11,836,698.072583107
url/new-url-properties.js n=100000 method="new" prop="host" type="idn": 6,072,991.651033267
url/new-url-properties.js n=100000 method="old" prop="host" type="auth": 11,501,686.664840966
url/new-url-properties.js n=100000 method="new" prop="host" type="auth": 5,357,784.547517147
url/new-url-properties.js n=100000 method="old" prop="host" type="special": 8,974,045.803170817
url/new-url-properties.js n=100000 method="new" prop="host" type="special": 5,829,677.008494248
Results of `url.hostname`
url/new-url-properties.js n=100000 method="old" prop="hostname" type="long": 11,223,056.10776109
url/new-url-properties.js n=100000 method="new" prop="hostname" type="long": 6,430,740.793044099
url/new-url-properties.js n=100000 method="old" prop="hostname" type="short": 11,458,170.173764298
url/new-url-properties.js n=100000 method="new" prop="hostname" type="short": 5,221,261.939329145
url/new-url-properties.js n=100000 method="old" prop="hostname" type="idn": 9,601,310.386841595
url/new-url-properties.js n=100000 method="new" prop="hostname" type="idn": 4,953,392.538922767
url/new-url-properties.js n=100000 method="old" prop="hostname" type="auth": 8,185,137.9993803855
url/new-url-properties.js n=100000 method="new" prop="hostname" type="auth": 4,500,329.131571037
url/new-url-properties.js n=100000 method="old" prop="hostname" type="special": 9,691,541.493947245
url/new-url-properties.js n=100000 method="new" prop="hostname" type="special": 5,756,141.083017945
Results of `url.port`
url/new-url-properties.js n=100000 method="old" prop="port" type="long": 11,342,818.424956651
url/new-url-properties.js n=100000 method="new" prop="port" type="long": 6,128,693.993696026
url/new-url-properties.js n=100000 method="old" prop="port" type="short": 11,457,772.3798939
url/new-url-properties.js n=100000 method="new" prop="port" type="short": 5,535,808.710794296
url/new-url-properties.js n=100000 method="old" prop="port" type="idn": 11,054,064.767534124
url/new-url-properties.js n=100000 method="new" prop="port" type="idn": 5,424,287.79101304
url/new-url-properties.js n=100000 method="old" prop="port" type="auth": 10,687,846.272859434
url/new-url-properties.js n=100000 method="new" prop="port" type="auth": 6,240,790.93287967
url/new-url-properties.js n=100000 method="old" prop="port" type="special": 10,964,146.473541267
url/new-url-properties.js n=100000 method="new" prop="port" type="special": 6,244,516.143978809
Results of `url.pathname`
url/new-url-properties.js n=100000 method="old" prop="pathname" type="long": 9,257,141.259624766
url/new-url-properties.js n=100000 method="new" prop="pathname" type="long": 2,264,299.754885023
url/new-url-properties.js n=100000 method="old" prop="pathname" type="short": 9,944,587.762528416
url/new-url-properties.js n=100000 method="new" prop="pathname" type="short": 1,853,560.5944435555
url/new-url-properties.js n=100000 method="old" prop="pathname" type="idn": 10,553,184.196437815
url/new-url-properties.js n=100000 method="new" prop="pathname" type="idn": 4,409,727.735913048
url/new-url-properties.js n=100000 method="old" prop="pathname" type="auth": 9,023,485.60645764
url/new-url-properties.js n=100000 method="new" prop="pathname" type="auth": 4,356,949.349461714
url/new-url-properties.js n=100000 method="old" prop="pathname" type="special": 11,092,131.242096856
url/new-url-properties.js n=100000 method="new" prop="pathname" type="special": 2,065,724.793938271
Results of `url.search`
url/new-url-properties.js n=100000 method="old" prop="search" type="long": 11,041,101.93730487
url/new-url-properties.js n=100000 method="new" prop="search" type="long": 6,280,379.767028056
url/new-url-properties.js n=100000 method="old" prop="search" type="short": 8,030,524.989146745
url/new-url-properties.js n=100000 method="new" prop="search" type="short": 5,765,022.524519505
url/new-url-properties.js n=100000 method="old" prop="search" type="idn": 10,384,961.163879983
url/new-url-properties.js n=100000 method="new" prop="search" type="idn": 5,369,139.047815405
url/new-url-properties.js n=100000 method="old" prop="search" type="auth": 8,907,717.031403532
url/new-url-properties.js n=100000 method="new" prop="search" type="auth": 4,778,068.512628841
url/new-url-properties.js n=100000 method="old" prop="search" type="special": 10,703,034.14963591
url/new-url-properties.js n=100000 method="new" prop="search" type="special": 6,278,603.354821017
Results of `url.hash`
url/new-url-properties.js n=100000 method="old" prop="hash" type="long": 11,636,972.990585689
url/new-url-properties.js n=100000 method="new" prop="hash" type="long": 5,642,725.316702191
url/new-url-properties.js n=100000 method="old" prop="hash" type="short": 9,114,039.695106206
url/new-url-properties.js n=100000 method="new" prop="hash" type="short": 5,862,102.824214588
url/new-url-properties.js n=100000 method="old" prop="hash" type="idn": 10,639,332.37763757
url/new-url-properties.js n=100000 method="new" prop="hash" type="idn": 5,664,185.507966138
url/new-url-properties.js n=100000 method="old" prop="hash" type="auth": 11,295,987.518385632
url/new-url-properties.js n=100000 method="new" prop="hash" type="auth": 5,518,077.082570574
url/new-url-properties.js n=100000 method="old" prop="hash" type="special": 7,582,483.583354356
url/new-url-properties.js n=100000 method="new" prop="hash" type="special": 5,381,531.766912944

@mscdex
Copy link
Contributor

mscdex commented Jan 7, 2017

I think using names like 'original' and 'whatwg' or something similar might be more descriptive?

@joyeecheung
Copy link
Member Author

I name it this way because there is a new-url-parse that does the same thing for parsing functions, so --filter new-url can see the results from both of them. I definitely agree there could be a better naming convention, but not sure if this should happen in this PR?

@jasnell
Copy link
Member

jasnell commented Jan 7, 2017

I'd be good with renaming those in this PR

@joyeecheung
Copy link
Member Author

I think whatwg-* should be reserved for benchmarks that only benchmark whatwg url APIs. Maybe old-vs-new-url-*? Or they can have a separate folder?

var obj = new URL(input);
var noDead = '';

if (prop === 'stringifier') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be happier with the wording "serializer" considering that's the spec definition, but strinigifier works too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I grabbed that name from the API definition in the spec https://url.spec.whatwg.org/#URL-stringification-behavior

if (prop === 'stringifier') {
bench.start();
for (var i = 0; i < n; i += 1) {
noDead = obj.toString();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit unfair as the original url stores the query string unparsed, while WHATWG URL serializer has to serialize the searchParams as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not about fairness really, because they look the same from end users' perspective

};

const bench = common.createBenchmark(main, {
type: Object.keys(inputs),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/type/input/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grab that from new-url-parse, I don't have an opinion about this but I guess a little bit consistency wouldn't hurt?

type: Object.keys(inputs),
prop: ['stringifier', 'protocol', 'auth', 'host', 'hostname', 'port',
'pathname', 'search', 'hash'],
method: ['old', 'new'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is a vestige of new-url-parse, but I think Node.js/legacy vs WHATWG is clearer.

Also the prop name method doesn't really convey the difference here, I think.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah legacy and whatwg would be much clearer! Thanks for the suggestion.

Can't think of a better alternative of "method" though...

bench.end(n);
}

assert.ok(!noDead || noDead.length > 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this?

Copy link
Member Author

@joyeecheung joyeecheung Jan 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a habit, make sure it won't get dead code elimination(V8 can't do that for these cases at the moment but..A smarter JIT usually would

Copy link
Member Author

@joyeecheung joyeecheung Jan 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooops, just took a look into the IR of method="old" ones, and it looks like the whole section inside useOld got elimiated :/ Will update to move the check into the main function. (The new ones aren't affected because...Crankshaft can't figure this out when there are getters involved I guess)

const common = require('../common.js');
const url = require('url');
const URL = url.URL;
const v8 = require('v8');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Forgot to run the linter :P

@TimothyGu
Copy link
Member

IMO the file name should also make it clear that this benchmark concerns reading properties only, and TBH the entire benchmark is a bit pointless as it's comparing straight JS property access with the performance of getter functions.

@joyeecheung
Copy link
Member Author

@TimothyGu Yeah it could seem a little unfair because optimization usually don't go hand in hand with specs, but IMO if users want to switch, they wouldn't care about the internals, but they would want to know about the performance impact. If the performance impact is inevitable, at least we can know how much it would be, and do a little bit expectation management.

As said in the PR message, I agree the current way this benchmark is implemented could be too "micro"(like most of them have loop invariants that just don't get optimized by the JIT because they jump too many hoops :P), so this is more like a first attempt. Maybe the operations in each cycle can be a little bit more sophisticated?

@joyeecheung
Copy link
Member Author

@jasnell @TimothyGu @mscdex I've refactored the parse benchmark a bit, and separated the serialization benchmark out. Also stopped benchmarking individual properties because I find them too "micro" to get right (and turns out Crankshaft can't optimize obj[prop] to LoadNamedField even when prop is a constant). PTAL and see if there is anything that should be improved :).

idn: 'http://你好你好',
auth: 'https://user:pass@example.com/path?search=1',
special: 'file:///foo/bar/test/node.js'
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're including an IDN test, it would be worthwhile also testing a case that uses pct-encoded characters in the domain also

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, let's include a test that requires dot segment normalization.... e.g.

https://example.org/./a/../b/./c

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should have zero impact on the getter performance but it's good to be complete

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. I'll add those to the inputs.

@jasnell
Copy link
Member

jasnell commented Jan 10, 2017

Couple of minor optional comments. LGTM


function useWHATWG(n, input) {
var obj = new URL(input);
var noDead = {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do these need to be initialized?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a habit of initalizing everything...can switch to intializing the properties I think.

var noDead = {};
bench.start();
for (var i = 0; i < n; i += 1) {
noDead = {
Copy link
Contributor

@mscdex mscdex Jan 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of creating a new object every iteration, what about just pre-defining the properties in var noDead = { /* ... */ } and then just re-assigning the individual properties inside the loop?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that would be better. I was not sure about this because some properties might be null, but come to think of it maybe I can just intialize them all to undefined.

@joyeecheung joyeecheung changed the title benchmark: compare WHATWG URL props with old API benchmark: improve WHATWG URL benchmarks Jan 12, 2017
@joyeecheung
Copy link
Member Author

@mscdex @jasnell Updated, PTAL.

@TimothyGu Does this LGTY now? (See #10678 (comment))

};
bench.start();
for (var i = 0; i < n; i += 1) {
noDead = {
Copy link
Contributor

@mscdex mscdex Jan 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the other instance below need to be changed yet to

noDead.protocol = obj.protocol;
noDead.auth = obj.auth;
// etc...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, forgot about this bit. Thanks & fixed :).

throw new Error('Unknown method');
}

assert.ok(noDead);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the return noDead in each function are unnecessary.

Copy link
Member Author

@joyeecheung joyeecheung Jan 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Crankshaft is able to do code motion if we simply do var protocol = obj.protocol and leave us timing an empty loop in the legacy version(WHATWG version is not affected because V8's current limitation of closures affects the getters). At the moment looks like it's the fear of changing the hidden class of noDead makes it back off from doing code motion for the legacy implementation(by looking at the output of --trace_gvn), so keeping noDead not dead could be a little bit more future-proof.

Aside: another way would be to add some interface to bench so it can suspend and resume the timer at anytime, then we can have more flexibility when it comes to avoiding loop invariant code motion, like generating different inputs based on i for each cycle.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's absolutely needed, then there should be some comments above each explaining things a bit, otherwise someone may come along and submit a PR to remove them without knowing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, I will at some comments to the declaration of noDead in main.

throw new Error('Unknown method');
}

assert.ok(noDead);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

throw new Error('Unknown method');
}

assert.ok(noDead);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

@joyeecheung
Copy link
Member Author

* add benchmark to compare the performance of getting url
  properties between the WHATWG URL and the legacy implementation
* add benchmark to compare the performance of serializing urls
  between the WHATWG URL and the legacy implementation
* refactor the benchmark for comparing parsing performance
  between the two implementations
@joyeecheung
Copy link
Member Author

Squashed with new commit messages. CI: https://ci.nodejs.org/job/node-test-pull-request/5858/

@joyeecheung
Copy link
Member Author

Also:

The new benchmark numbers

url/legacy-vs-whatwg-url-get-prop.js
url/legacy-vs-whatwg-url-get-prop.js n=100000 method="legacy" type="long": 50,075,965.23926797
url/legacy-vs-whatwg-url-get-prop.js n=100000 method="whatwg" type="long": 2,291,901.7919165404
url/legacy-vs-whatwg-url-get-prop.js n=100000 method="legacy" type="short": 44,543,767.14656637
url/legacy-vs-whatwg-url-get-prop.js n=100000 method="whatwg" type="short": 2,693,135.593263703
url/legacy-vs-whatwg-url-get-prop.js n=100000 method="legacy" type="idn": 57,215,569.9586217
url/legacy-vs-whatwg-url-get-prop.js n=100000 method="whatwg" type="idn": 10,328,543.746598681
url/legacy-vs-whatwg-url-get-prop.js n=100000 method="legacy" type="auth": 52,484,208.81367318
url/legacy-vs-whatwg-url-get-prop.js n=100000 method="whatwg" type="auth": 5,589,582.136813407
url/legacy-vs-whatwg-url-get-prop.js n=100000 method="legacy" type="special": 58,805,472.67250879
url/legacy-vs-whatwg-url-get-prop.js n=100000 method="whatwg" type="special": 3,006,802.138137
url/legacy-vs-whatwg-url-get-prop.js n=100000 method="legacy" type="percent": 50,962,503.31893303
url/legacy-vs-whatwg-url-get-prop.js n=100000 method="whatwg" type="percent": 7,918,931.052005441
url/legacy-vs-whatwg-url-get-prop.js n=100000 method="legacy" type="dot": 55,960,397.94558187
url/legacy-vs-whatwg-url-get-prop.js n=100000 method="whatwg" type="dot": 2,843,747.021174995

url/legacy-vs-whatwg-url-parse.js
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="long": 173,440.6734304517
url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="long": 144,078.3534509074
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="short": 350,785.01283520606
url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="short": 225,027.1055837463
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="idn": 234,960.78679514176
url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="idn": 215,156.16250506561
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="auth": 218,406.10791201613
url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="auth": 181,733.01544909275
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="special": 172,989.3698966341
url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="special": 255,604.2013519438
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="percent": 187,444.3572597002
url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="percent": 239,653.48847202852
url/legacy-vs-whatwg-url-parse.js n=100000 method="legacy" type="dot": 303,996.1587045386
url/legacy-vs-whatwg-url-parse.js n=100000 method="whatwg" type="dot": 212,832.1804061591

url/legacy-vs-whatwg-url-serialize.js
url/legacy-vs-whatwg-url-serialize.js n=100000 method="legacy" type="long": 1,854,430.1622620828
url/legacy-vs-whatwg-url-serialize.js n=100000 method="whatwg" type="long": 1,435,405.393650599
url/legacy-vs-whatwg-url-serialize.js n=100000 method="legacy" type="short": 1,760,575.2207699707
url/legacy-vs-whatwg-url-serialize.js n=100000 method="whatwg" type="short": 1,450,454.8553903762
url/legacy-vs-whatwg-url-serialize.js n=100000 method="legacy" type="idn": 2,268,471.8772664163
url/legacy-vs-whatwg-url-serialize.js n=100000 method="whatwg" type="idn": 6,378,045.237561456
url/legacy-vs-whatwg-url-serialize.js n=100000 method="legacy" type="auth": 1,772,154.3303991065
url/legacy-vs-whatwg-url-serialize.js n=100000 method="whatwg" type="auth": 3,690,401.991429484
url/legacy-vs-whatwg-url-serialize.js n=100000 method="legacy" type="special": 1,942,786.2278293364
url/legacy-vs-whatwg-url-serialize.js n=100000 method="whatwg" type="special": 1,733,863.7708090094
url/legacy-vs-whatwg-url-serialize.js n=100000 method="legacy" type="percent": 1,956,899.7908993866
url/legacy-vs-whatwg-url-serialize.js n=100000 method="whatwg" type="percent": 5,244,297.7439555535
url/legacy-vs-whatwg-url-serialize.js n=100000 method="legacy" type="dot": 2,049,642.0013294797
url/legacy-vs-whatwg-url-serialize.js n=100000 method="whatwg" type="dot": 1,715,905.9609406267

@joyeecheung
Copy link
Member Author

@mscdex Does this LGTY?

@mscdex
Copy link
Contributor

mscdex commented Jan 14, 2017

LGTM

@joyeecheung
Copy link
Member Author

Landed in d4b749b

joyeecheung added a commit that referenced this pull request Jan 15, 2017
* add benchmark to compare the performance of getting url
  properties between the WHATWG URL and the legacy implementation
* add benchmark to compare the performance of serializing urls
  between the WHATWG URL and the legacy implementation
* refactor the benchmark for comparing parsing performance
  between the two implementations

PR-URL: #10678
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 18, 2017
* add benchmark to compare the performance of getting url
  properties between the WHATWG URL and the legacy implementation
* add benchmark to compare the performance of serializing urls
  between the WHATWG URL and the legacy implementation
* refactor the benchmark for comparing parsing performance
  between the two implementations

PR-URL: nodejs#10678
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 23, 2017
* add benchmark to compare the performance of getting url
  properties between the WHATWG URL and the legacy implementation
* add benchmark to compare the performance of serializing urls
  between the WHATWG URL and the legacy implementation
* refactor the benchmark for comparing parsing performance
  between the two implementations

PR-URL: nodejs#10678
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 25, 2017
* add benchmark to compare the performance of getting url
  properties between the WHATWG URL and the legacy implementation
* add benchmark to compare the performance of serializing urls
  between the WHATWG URL and the legacy implementation
* refactor the benchmark for comparing parsing performance
  between the two implementations

PR-URL: nodejs#10678
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 27, 2017
* add benchmark to compare the performance of getting url
  properties between the WHATWG URL and the legacy implementation
* add benchmark to compare the performance of serializing urls
  between the WHATWG URL and the legacy implementation
* refactor the benchmark for comparing parsing performance
  between the two implementations

PR-URL: nodejs#10678
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
@italoacasas italoacasas mentioned this pull request Jan 29, 2017
@joyeecheung joyeecheung deleted the url-properties-benchmark branch February 19, 2017 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmark Issues and PRs related to the benchmark subsystem. url Issues and PRs related to the legacy built-in url module. whatwg-url Issues and PRs related to the WHATWG URL implementation.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

6 participants