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: unify input to url-related benchmarks #11264

Closed
wants to merge 3 commits into from

Conversation

joyeecheung
Copy link
Member

@joyeecheung joyeecheung commented Feb 9, 2017

This PR moves common input to url-related benchmarks into fixtures and removes duplicate benchmarks

  • url-parse.js is covered by legacy-vs-whatwg-url-parse.js with method="legacy"
  • stringifier benchmark in whatwg-url-properties.js is covered by legacy-vs-whatwg-url-serialize.js with method="legacy" (it is still worth keeping because legacy-vs-whatwg-url-get-prop.js benchmarks getting all properties at once while whatwg-url-properties.js benchmarks getting/setting individual property)

Some of the search params cases are taken from #11234 per suggestion from #11170 (review)

cc @nodejs/url

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

benchmark, url

@nodejs-github-bot nodejs-github-bot added the benchmark Issues and PRs related to the benchmark subsystem. label Feb 9, 2017
@joyeecheung joyeecheung added whatwg-url Issues and PRs related to the WHATWG URL implementation. querystring Issues and PRs related to the built-in querystring module. url Issues and PRs related to the legacy built-in url module. labels Feb 9, 2017
'foo=ghi&foo=jkl&foo=mno&foo=pqr&foo=stu&foo=vwxyz',
manypairs: 'a&b&c&d&e&f&g&h&i&j&k&l&m&n&o&p&q&r&s&t&u&v&w&x&y&z'
};
var inputs = inputs = require('../fixtures/url-inputs.js').searchParams;
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicate assignment

Copy link
Member Author

Choose a reason for hiding this comment

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

Ooop, thanks for catching that.

case 'origin':
case 'searchParams':
get(n, url, prop);
break;
case 'toString':
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is covered in legacy-vs-whatwg-url-serialize.js with method="whatwg", also href is an alias of toString so we can just look at the results of href.

@mscdex
Copy link
Contributor

mscdex commented Feb 9, 2017

There's a typo in the second commit message.

@joyeecheung
Copy link
Member Author

@mscdex Thanks for the review, updated, PTAL.

@joyeecheung
Copy link
Member Author

@joyeecheung
Copy link
Member Author

@mscdex Can I have a LGTM please? Thanks!

@joyeecheung
Copy link
Member Author

Rebased

ws: 'ws://localhost:9229/f46db715-70df-43ad-a359-7f9949f39868',
javascript: 'javascript:alert("node is awesome");',
percent: 'https://%E4%BD%A0/foo',
dot: '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.

Could we add mailto:domain@example.com into here as an example case of mailto protocol?

Copy link
Member Author

Choose a reason for hiding this comment

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

That should probably just hit the same code paths as 'javascript:alert("node is awesome");'

@mscdex
Copy link
Contributor

mscdex commented Feb 15, 2017

@mscdex
Copy link
Contributor

mscdex commented Feb 15, 2017

CI is green, LGTM.

jasnell pushed a commit that referenced this pull request Feb 15, 2017
PR-URL: #11264
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
jasnell pushed a commit that referenced this pull request Feb 15, 2017
PR-URL: #11264
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
jasnell pushed a commit that referenced this pull request Feb 15, 2017
PR-URL: #11264
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
@jasnell
Copy link
Member

jasnell commented Feb 15, 2017

Landed in e571fd4...7ee9504

@jasnell jasnell closed this Feb 15, 2017
italoacasas pushed a commit to italoacasas/node that referenced this pull request Feb 16, 2017
PR-URL: nodejs#11264
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Feb 16, 2017
PR-URL: nodejs#11264
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
TimothyGu pushed a commit to TimothyGu/node that referenced this pull request Feb 18, 2017
@joyeecheung joyeecheung deleted the unify-url-bench branch February 19, 2017 17:44
italoacasas pushed a commit to italoacasas/node that referenced this pull request Feb 20, 2017
italoacasas pushed a commit that referenced this pull request Feb 22, 2017
PR-URL: #11264
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
italoacasas pushed a commit that referenced this pull request Feb 22, 2017
PR-URL: #11264
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
italoacasas pushed a commit that referenced this pull request Feb 22, 2017
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. querystring Issues and PRs related to the built-in querystring module. 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 this pull request may close these issues.

6 participants