| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Instead of calling into C++ each time we need to check the value of a command line option, cache the option map in a new `internal/options` module for faster access to the values in JS land.
|
@joyeecheung build started: https://ci.nodejs.org/blue/organizations/jenkins/node-test-pull-request-lite-pipeline/detail/node-test-pull-request-lite-pipeline/1490/pipeline |
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM with 1 comment
Sorry, something went wrong.
| return id.startsWith('internal/') || | ||
| (id === 'worker_threads' && | ||
| !internalBinding('options').getOptions('--experimental-worker')); | ||
| (id === 'worker_threads' && !config.experimentalWorker); |
There was a problem hiding this comment.
Can we avoid going back to process.config? 😕
Sorry, something went wrong.
There was a problem hiding this comment.
There are also two other reference to config in here, I think a better option would probably be to just specialize something for NativeModule here - maybe just directly generate the whole map when the process starts and pass it to the loader bootstrapper here and let NativeModule short-circuit the internal/options implementation. That also opens up the opportunity to emit all the warning for experimental modules in one place here instead of emitting them everywhere across the code base.
EDIT: wait, we emit them regardless of the cli options..so never mind I guess
Sorry, something went wrong.
|
Fixed linter and the bootstrap module list test: https://ci.nodejs.org/job/node-test-pull-request/18336/ |
Sorry, something went wrong.
Sorry, something went wrong.
I get that motivation, but couldn't we make it simpler? I'd be happy to share your reasoning. |
Sorry, something went wrong.
|
@refack See #24091 (comment) my reasoning is we could just eliminate calling into C++ at all eventually by creating the map before bootstrapping loaders so it will be made available in loafers.js as an argument directly. This PR just moves the calls to a central place that can be manipulated in loaders.js |
Sorry, something went wrong.
|
Resume: https://ci.nodejs.org/job/node-test-commit/22901/ |
Sorry, something went wrong.
@refack Just to explore about this point a bit further - I think the reason why test/parallel/test-bootstrap-modules.js exists is to make sure we load less stuff during the bootstrap if they are not really necessary. In this case, the options have to be loaded during the bootstrap no matter what since it is conceptually a dependency of the bootstrap process (whereas things like TCPWrap really are not and they are the main targets that test/parallel/test-bootstrap-modules.js tests against). |
Sorry, something went wrong.
Main reason sure, but it's also been quoted as a braier for adding new (trivial) modules - #23081 (review) Again, I'm slightly in favor... Encapsulation/Performance is just a balance we should keep in mind. |
Sorry, something went wrong.
|
ubuntu-on-arm had a flake, so resume again: https://ci.nodejs.org/job/node-test-commit/22902/ |
Sorry, something went wrong.
Instead of calling into C++ each time we need to check the value of a command line option, cache the option map in a new `internal/options` module for faster access to the values in JS land. PR-URL: nodejs#24091 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Refael Ackermann <refack@gmail.com>
Instead of calling into C++ each time we need to check the value of a command line option, cache the option map in a new `internal/options` module for faster access to the values in JS land. PR-URL: #24091 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Refael Ackermann <refack@gmail.com>
Instead of calling into C++ each time we need to check the value of a command line option, cache the option map in a new `internal/options` module for faster access to the values in JS land. PR-URL: nodejs#24091 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Refael Ackermann <refack@gmail.com>
Instead of calling into C++ each time we need to check the value of a command line option, cache the option map in a new `internal/options` module for faster access to the values in JS land. PR-URL: #24091 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Refael Ackermann <refack@gmail.com>
Instead of calling into C++ each time we need to check the value of a command line option, cache the option map in a new `internal/options` module for faster access to the values in JS land. PR-URL: #24091 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Refael Ackermann <refack@gmail.com>
Instead of calling into C++ each time we need to check the value of a command line option, cache the option map in a new `internal/options` module for faster access to the values in JS land. PR-URL: #24091 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Refael Ackermann <refack@gmail.com>
| Back | FazBrowse Home | New Git URL |
Instead of calling into C++ each time we need to check the value
of a command line option, cache the option map in a new
internal/options module for faster access to the values in JS land.