You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Better integrity check when using the code cache in NativeModule.prototype.compile (right now SerializedCodeData::SourceHash returns source->length()) e.g. calculating the checksums of the source code in both js2c and the code cache generator and compare them before using the cache. See build: speed up startup with V8 code cache #21405 (comment) simply relying on V8 to do the checks is fine
build: create V8 code cache after script is run #21567: Use script.createCachedData to generate the code cache after the builtin modules have runInThisContext(), so that the cache of the lazily compiled inner functions are also included (right now only the top level function is included in the cache),see build: speed up startup with V8 code cache #21405 (comment) . We may need to include the code cache generator in core or expose the scripts to user land.
(might be related if we still use JS to generate the cache) Add support for the full range of CompileOptions (and possibly NoCacheReason) to ContextifyScript/vm.Script it's not using the JS land function anymore
Long-term action items
Refactors node.js and/or node.cc so that we can create something like a mkcodecache (similar to mksnapshot) target instead of generating the code cache with a user-land JS script tools: implement mkcodecache as an executable #27135
Resolve the dependency issue automatically in build files: make sure when the inputs to node_js2c is modified, the cache will be regenerated and compiled the next time Node.js is built with node_code_cache_pathbuild,tools: use mkcodecache to add code cache to the binaries #27161
Following up on #21405
Better integrity check when using the code cache insimply relying on V8 to do the checks is fineNativeModule.prototype.compile(right nowSerializedCodeData::SourceHashreturnssource->length()) e.g. calculating the checksums of the source code in both js2c and the code cache generator and compare them before using the cache. See build: speed up startup with V8 code cache #21405 (comment)script.createCachedDatato generate the code cache after the builtin modules haverunInThisContext(), so that the cache of the lazily compiled inner functions are also included (right now only the top level function is included in the cache),see build: speed up startup with V8 code cache #21405 (comment) . We may need to include the code cache generator in core or expose the scripts to user land.internal/bootstrap/loaders.jsandinternal/bootstrap/node.js(these two are compiled in C++): src: use NativeModuleLoader to compile all the bootstrappers #24775(might be related if we still use JS to generate the cache) Add support for the full range ofit's not using the JS land function anymoreCompileOptions(and possiblyNoCacheReason) toContextifyScript/vm.ScriptLong-term action items
node.jsand/ornode.ccso that we can create something like amkcodecache(similar tomksnapshot) target instead of generating the code cache with a user-land JS script tools: implement mkcodecache as an executable #27135node_js2cis modified, the cache will be regenerated and compiled the next time Node.js is built withnode_code_cache_pathbuild,tools: use mkcodecache to add code cache to the binaries #27161test-code-cacheis run in the release CI to make sure we don't have a ~100% performance regression of startup time:build: build release/CI on non-Windows with code cache #22934build,tools: use mkcodecache to add code cache to the binaries #27161