Skip to content

[v18.x backport] src,lib: reducing C++ calls of esm legacy main resolve - #49644

Closed
H4ad wants to merge 5 commits into
nodejs:v18.x-stagingfrom
H4ad:backport-48325-to-v18.x
Closed

[v18.x backport] src,lib: reducing C++ calls of esm legacy main resolve #49644
H4ad wants to merge 5 commits into
nodejs:v18.x-stagingfrom
H4ad:backport-48325-to-v18.x

Conversation

@H4ad

@H4adH4ad commented Sep 14, 2023

Copy link
Copy Markdown
Member

Backport of #48325

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/loaders

@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. v18.x labels Sep 14, 2023
@H4ad

H4ad commented Sep 14, 2023

Copy link
Copy Markdown
MemberAuthor

I didn't know how backport works but this PR should be landed with #48664 since they contain fixes that were not detected in this initial PR.

Comment threadlib/internal/modules/esm/resolve.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you sure this is correct? href attribute of a URL always returns string.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Yes, it always returns a string, but since I didn't know for sure if packageJSONUrl is a URL, in the old code we had validations but in this one I needed to make this validation explicit.

@H4ad
H4adforce-pushed the backport-48325-to-v18.x branch 2 times, most recently from 3a1addf to 4f095e1CompareSeptember 18, 2023 01:37
@nodejs-github-bot

nodejs-github-bot commented Oct 3, 2023

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@targos

Copy link
Copy Markdown
Member

Hey, I'm sorry but a lot of commit landed on the staging branch since you opened this backport and now it has conflicts.

Instead of many C++ calls, now we make only one C++ call
to return a enum number that represents the selected state.
Backport-PR-URL: nodejs#48325
@H4ad

H4ad commented Dec 2, 2023

Copy link
Copy Markdown
MemberAuthor

@targos It's okay to include #48664 in this PR since they should land together?

@H4ad
H4adforce-pushed the backport-48325-to-v18.x branch from 4f095e1 to 2c8a182CompareDecember 2, 2023 02:09
@H4ad
H4ad requested a review from targosDecember 2, 2023 02:45
@targos

Copy link
Copy Markdown
Member

Yes it's ok!

PR-URL: nodejs#48664
Refs: nodejs#48325
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Backport-PR-URL: nodejs#48664
@H4ad

H4ad commented Dec 3, 2023

Copy link
Copy Markdown
MemberAuthor

@targos Done!

@richardlau

richardlau commented Jan 12, 2024

Copy link
Copy Markdown
Member

@nodejs/lts / @nodejs/releasers Now that Node.js 18 is in maintenance I think the risks of this backport PR outweigh potential benefits. Thoughts?

@ruyadorno

Copy link
Copy Markdown
Member

@nodejs/lts / @nodejs/releasers Now that Node.js 18 is in maintenance I think the risks of this backport PR outweigh potential benefits. Thoughts?

+1, I don't think we should be landing performance improvement backports in a maintenance release line

@H4ad

H4ad commented Jan 16, 2024

Copy link
Copy Markdown
MemberAuthor

I agree, this improvement helps but is not that significant that worth the risk.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++Issues and PRs that require attention from people who are familiar with C++.lib / srcIssues and PRs related to general changes in the lib or src directory.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@H4ad@nodejs-github-bot@targos@richardlau@ruyadorno@anonrig@aduh95