Skip to content

Conversation

@mscdex
Copy link
Contributor

@mscdexmscdex commented May 11, 2017

Benchmark results:

 improvement confidence p.value http/create-clientrequest.js n=1000000 len=1 7.01 % *** 1.281605e-08 http/create-clientrequest.js n=1000000 len=128 4.02 % *** 6.564820e-04 http/create-clientrequest.js n=1000000 len=16 6.01 % *** 8.660607e-07 http/create-clientrequest.js n=1000000 len=32 5.68 % *** 9.863084e-06 http/create-clientrequest.js n=1000000 len=64 6.97 % *** 9.791414e-10 http/create-clientrequest.js n=1000000 len=8 7.65 % *** 1.141693e-09 

CI: https://ci.nodejs.org/job/node-test-pull-request/8025/

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)
  • http
  • https

@mscdexmscdex added http Issues or PRs related to the http subsystem. https Issues or PRs related to the https subsystem. performance Issues and PRs related to the performance of Node.js. labels May 11, 2017
@nodejs-github-botnodejs-github-bot added http Issues or PRs related to the http subsystem. https Issues or PRs related to the https subsystem. labels May 11, 2017
lib/https.js Outdated
Copy link
Member

Choose a reason for hiding this comment

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

Would a require('internal/url').isURL() utility function be worthwhile to make this more convenient? Or would that kill any perf gain? I imagine wanting to use similar checks elsewhere.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

See here.

Copy link
Member

Choose a reason for hiding this comment

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

Ha! I thought the question sounded familiar as I was typing it ;-)

Copy link
Member

@TimothyGuTimothyGu left a comment

Choose a reason for hiding this comment

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

It's unfortunate we can't write an isURL without performance regression, but 🤷‍♂️

Copy link
Member

Choose a reason for hiding this comment

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

I am now wondering if this way of checking URLs is a bit hard to understand for someone who don't know the implementation details of URL...

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

There's not a whole lot that can be done about that. Using a helper function as previously noted incurs a measurable performance hit.

Copy link
Member

Choose a reason for hiding this comment

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

@mscdex Maybe a comment would help?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Done.

@mscdexmscdexforce-pushed the http-client-avoid-instanceof-url branch 2 times, most recently from 43954e6 to 41ea7e9CompareMay 22, 2017 20:06
@mscdex
Copy link
ContributorAuthor

PR-URL: nodejs#12983 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
@mscdexmscdexforce-pushed the http-client-avoid-instanceof-url branch from 41ea7e9 to ed36565CompareMay 22, 2017 22:07
@mscdexmscdex merged commit ed36565 into nodejs:masterMay 22, 2017
@mscdexmscdex deleted the http-client-avoid-instanceof-url branch May 22, 2017 22:09
jasnell pushed a commit that referenced this pull request May 23, 2017
PR-URL: #12983 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
jasnell pushed a commit that referenced this pull request May 23, 2017
PR-URL: #12983 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
@jasnelljasnell mentioned this pull request May 28, 2017
@gibfahngibfahn mentioned this pull request Jun 15, 2017
3 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

httpIssues or PRs related to the http subsystem.httpsIssues or PRs related to the https subsystem.performanceIssues and PRs related to the performance of Node.js.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@mscdex@jasnell@TimothyGu@watilde@cjihrig@joyeecheung@BridgeAR@MylesBorins@nodejs-github-bot