Skip to content

Conversation

@anonrig
Copy link
Member

This pull request avoids multiple calls to the protocol getter of the URL. Previor to Ada version 2, url.protocol was 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

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/loaders
  • @nodejs/modules

@nodejs-github-botnodejs-github-bot added esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. labels Apr 13, 2023
@anonriganonrigforce-pushed the esm-improve-protocol branch from bb4b123 to 8661421CompareApril 13, 2023 14:50
@anonriganonrig added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Apr 13, 2023
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 13, 2023
@nodejs-github-bot
Copy link
Collaborator

@lemire
Copy link
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.

@anonrig
Copy link
MemberAuthor

And I guess that we don’t expose the protocole type as an integer to JavaScript? If we did, we could avoid string comparisons.

That's a really good argument @lemire. I'll look for some alternatives after this pull request, to improve it even more.

@lemire
Copy link
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.

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@anonriganonrig added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 13, 2023
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 15, 2023
@nodejs-github-botnodejs-github-bot merged commit 93e550a into nodejs:mainApr 15, 2023
@nodejs-github-bot
Copy link
Collaborator

Landed in 93e550a

targos pushed a commit that referenced this pull request May 2, 2023
PR-URL: #47542 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Jacob Smith <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
@targostargos mentioned this pull request May 2, 2023
danielleadams pushed a commit that referenced this pull request Jul 6, 2023
PR-URL: #47542 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Jacob Smith <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
MoLow pushed a commit to MoLow/node that referenced this pull request Jul 6, 2023
PR-URL: nodejs#47542 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Jacob Smith <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.esmIssues and PRs related to the ECMAScript Modules implementation.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@anonrig@nodejs-github-bot@lemire@ljharb@Qard@lpinca@JakobJingleheimer@aduh95