esm: avoid accessing lazy getters for urls#47542
Merged
nodejs-github-bot merged 1 commit intonodejs:mainfrom Apr 15, 2023
Merged
esm: avoid accessing lazy getters for urls#47542nodejs-github-bot merged 1 commit intonodejs:mainfrom
nodejs-github-bot merged 1 commit intonodejs:mainfrom
Conversation
Collaborator
|
Review requested:
|
bb4b123 to
8661421
Compare
aduh95
approved these changes
Apr 13, 2023
Collaborator
Member
|
And I guess that we don’t expose the protocole type as an integer to JavaScript? If we did, we could avoid string comparisons. |
Member
Author
That's a really good argument @lemire. I'll look for some alternatives after this pull request, to improve it even more. |
Member
|
I would expect that if you have several instances of the protocol string in JavaScript, that would be a performance penalty irrespective of the backend. Having just one reference is better. |
lemire
approved these changes
Apr 13, 2023
ljharb
approved these changes
Apr 13, 2023
Qard
approved these changes
Apr 13, 2023
Collaborator
JakobJingleheimer
approved these changes
Apr 13, 2023
lpinca
approved these changes
Apr 13, 2023
Collaborator
33 tasks
Collaborator
|
Landed in 93e550a |
targos
pushed a commit
that referenced
this pull request
May 2, 2023
PR-URL: #47542 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
danielleadams
pushed a commit
that referenced
this pull request
Jul 6, 2023
PR-URL: #47542 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
MoLow
pushed a commit
to MoLow/node
that referenced
this pull request
Jul 6, 2023
PR-URL: nodejs#47542 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request avoids multiple calls to the
protocolgetter of the URL. Previor to Ada version 2,url.protocolwas always returned an already allocated string, but right now, it slices a new string for each call. Storing it in a variable and access it, would make some improvement in terms of performance.cc @nodejs/url