-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
src: port bootstrap/cache.js to C++ #27046
Conversation
cc @nodejs/process @nodejs/build-files PTAL, I am looking into rewriting |
OneByteString(isolate, "canBeRequired"), | ||
ToJsSet(context, can_be_required)) | ||
.FromJust(); | ||
info.GetReturnValue().Set(result); |
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.
Consider caching result
as an Environment
field or compute it eagerly inNativeModuleLoader::Initialize()
.
It feels kind of wasteful to recompute it every time and it breaks object identity (although that's more of an academic issue since it's only used internally.)
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.
I think it's actually kind of wasteful to compute this eagerly since this is only used in the code cache generator and the tests/benchmarks. Normal use cases do not need this at all, and the code that do use this only compute it once per process.
Linux will fail again because it got the bad ubuntu18-04 host again. I've taken it offline and will restart CI again. Windows already failed again. 😞 |
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.
lgtm overall though I haven't worked on this code :]
This allows us to query the categories of modules in C++ so we can implement the code cache generator in C++ that does not depend on a Node.js binary.
4e6fdad
to
a7f8857
Compare
Landed in e1d55a0 |
This allows us to query the categories of modules in C++
so we can implement the code cache generator in C++ that
does not depend on a Node.js binary.
Ref: #21563
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes