-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
Discussion/Tracking SnapshotCreator support #13877
Copy link
Copy link
Closed
Labels
discussIssues opened for discussions and feedbacks.Issues opened for discussions and feedbacks.lib / srcIssues and PRs related to general changes in the lib or src directory.Issues and PRs related to general changes in the lib or src directory.performanceIssues and PRs related to the performance of Node.js.Issues and PRs related to the performance of Node.js.processIssues and PRs related to the process subsystem.Issues and PRs related to the process subsystem.
Metadata
Metadata
Assignees
Labels
discussIssues opened for discussions and feedbacks.Issues opened for discussions and feedbacks.lib / srcIssues and PRs related to general changes in the lib or src directory.Issues and PRs related to general changes in the lib or src directory.performanceIssues and PRs related to the performance of Node.js.Issues and PRs related to the performance of Node.js.processIssues and PRs related to the process subsystem.Issues and PRs related to the process subsystem.
Relevant earlier discussion on #9473 .
v8::SnapshotCreatoris a means to capture a heap snapshot of JS, CodeGen, and C++ bindings and revive them w/o performing loading/evaluation steps that got to there. This issue is discussing what would be needed for tools likewebpackwhich run many times and have significant startup cost need in order to utilize snapshots.CC: @hashseed @refack
intptr_tintptr_ts--make-snapshotand--from-snapshotmain()functions for snapshots (save tov8::Private::ForApi($main_symbol_name)).vm.Contextfor snapshotrequire.cachepaths?The v8 API might be able to have some changes made(LANDED)Right now the v8 API would need a
--make-snapshotCLI flag sincev8::SnapshotCreatorcontrolsIsolatecreation and node would need to use the created isolate.Since all JS handles need to be closed when creating the snapshot, a
main()function would need to be declared during snapshot creation after all possible preloading has occurred. The snapshot could then be taken when node exits if exiting normally (note,unref'd handles may still exist).Some utility like
WarmUpSnapshotDataBlobfrom v8 so that the JIT code is warm when loaded off disk also relevant.