-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
[v18.x backport] src,lib: reducing C++ calls of esm legacy main resolve #49644
Conversation
Review requested:
|
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. |
return guess; | ||
const packageJsonUrlString = packageJSONUrl.href; | ||
|
||
if (typeof packageJsonUrlString !== 'string') { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
ef85828
to
490fc00
Compare
3a1addf
to
4f095e1
Compare
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
4f095e1
to
2c8a182
Compare
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
@targos Done! |
@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 |
I agree, this improvement helps but is not that significant that worth the risk. |
Backport of #48325