-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
startup snapshot integration in packaging solutions #42566
Comments
Thanks for the perspective. If I understand correctly the suggestion is that startup snapshots are another tool that might be used in a Single Executable application to speed up startup, but not the way to build a Single Executable application. That makes sense to me. |
@joyeecheung As you may know, we’re trying to use startup snapshots in our own packaging solution. This actually works very nicely for the most part, but we have run into the issue that we can’t distribute packaged SEAs with snapshots as easily because the Would it make sense to add a snapshotting mode in which we don’t pass |
I am thinking about adding some kind of configuration API in |
@joyeecheung That sounds awesome, yes! Please let me know if I can do something to help, this is probably the kind of thing I could spend some of my regular work time on 🙂 |
Actually on the particular issue about cpu features, after some discussions I believe it can just be ignored in the code cache version computation, so I uploaded https://chromium-review.googlesource.com/c/v8/v8/+/4905290 to remove it |
…ag() The code cache should be CPU-independent, we also do not actually check this during the deserialization of code cache, so there is no need to impose this in the embedder-facing CachedDataVersionTag() API. Refs: nodejs/node#42566 (comment) Change-Id: Ia1d677b949050add961af6fbf62c44342c061312
- Add support for --build-snapshot-config which allows passing snapshot configurations via a JSON configuration file. - Add support for node::SnapshotConfig in the embedder API The initial configurable options are: - "builder" (SnapshotConfig::builder_script_path): path to the builder script. - "withoutCodeCache" (SnapshotFlags::kWithoutCodeCache): disable code cache generation. PR-URL: #50453 Refs: #42566 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
- Add support for --build-snapshot-config which allows passing snapshot configurations via a JSON configuration file. - Add support for node::SnapshotConfig in the embedder API The initial configurable options are: - "builder" (SnapshotConfig::builder_script_path): path to the builder script. - "withoutCodeCache" (SnapshotFlags::kWithoutCodeCache): disable code cache generation. PR-URL: #50453 Refs: #42566 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Original commit message: [api] Add v8::ScriptCompiler::CachedData::CompatibilityCheck() This patch adds a new API v8::ScriptCompiler::CachedData::CompatibilityCheck() in order to allow embedders to check if the code cache can be used in the current isolate without looking up for the source code. It also returns more detailed reasons about why the code cache cannot be used when it's bound to be rejected. This makes it possible to enforce portability checks in case code code becomes CPU-dependent in the future. Refs: nodejs#42566 (comment) Change-Id: Ia1d677b949050add961af6fbf62c44342c061312 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4905290 Reviewed-by: Marja Hölttä <marja@chromium.org> Reviewed-by: Toon Verwaest <verwaest@chromium.org> Commit-Queue: Joyee Cheung <joyee@igalia.com> Cr-Commit-Position: refs/heads/main@{#90833} Refs: v8/v8@efb1133
Original commit message: [api] Add v8::ScriptCompiler::CachedData::CompatibilityCheck() This patch adds a new API v8::ScriptCompiler::CachedData::CompatibilityCheck() in order to allow embedders to check if the code cache can be used in the current isolate without looking up for the source code. It also returns more detailed reasons about why the code cache cannot be used when it's bound to be rejected. This makes it possible to enforce portability checks in case code code becomes CPU-dependent in the future. Refs: #42566 (comment) Change-Id: Ia1d677b949050add961af6fbf62c44342c061312 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4905290 Reviewed-by: Marja Hölttä <marja@chromium.org> Reviewed-by: Toon Verwaest <verwaest@chromium.org> Commit-Queue: Joyee Cheung <joyee@igalia.com> Cr-Commit-Position: refs/heads/main@{#90833} Refs: v8/v8@efb1133 PR-URL: #51551 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Original commit message: [api] Add v8::ScriptCompiler::CachedData::CompatibilityCheck() This patch adds a new API v8::ScriptCompiler::CachedData::CompatibilityCheck() in order to allow embedders to check if the code cache can be used in the current isolate without looking up for the source code. It also returns more detailed reasons about why the code cache cannot be used when it's bound to be rejected. This makes it possible to enforce portability checks in case code code becomes CPU-dependent in the future. Refs: nodejs#42566 (comment) Change-Id: Ia1d677b949050add961af6fbf62c44342c061312 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4905290 Reviewed-by: Marja Hölttä <marja@chromium.org> Reviewed-by: Toon Verwaest <verwaest@chromium.org> Commit-Queue: Joyee Cheung <joyee@igalia.com> Cr-Commit-Position: refs/heads/main@{#90833} Refs: v8/v8@efb1133 PR-URL: nodejs#51551 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Original commit message: [api] Add v8::ScriptCompiler::CachedData::CompatibilityCheck() This patch adds a new API v8::ScriptCompiler::CachedData::CompatibilityCheck() in order to allow embedders to check if the code cache can be used in the current isolate without looking up for the source code. It also returns more detailed reasons about why the code cache cannot be used when it's bound to be rejected. This makes it possible to enforce portability checks in case code code becomes CPU-dependent in the future. Refs: #42566 (comment) Change-Id: Ia1d677b949050add961af6fbf62c44342c061312 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4905290 Reviewed-by: Marja Hölttä <marja@chromium.org> Reviewed-by: Toon Verwaest <verwaest@chromium.org> Commit-Queue: Joyee Cheung <joyee@igalia.com> Cr-Commit-Position: refs/heads/main@{#90833} Refs: v8/v8@efb1133 PR-URL: #51551 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Original commit message: [api] Add v8::ScriptCompiler::CachedData::CompatibilityCheck() This patch adds a new API v8::ScriptCompiler::CachedData::CompatibilityCheck() in order to allow embedders to check if the code cache can be used in the current isolate without looking up for the source code. It also returns more detailed reasons about why the code cache cannot be used when it's bound to be rejected. This makes it possible to enforce portability checks in case code code becomes CPU-dependent in the future. Refs: nodejs#42566 (comment) Change-Id: Ia1d677b949050add961af6fbf62c44342c061312 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4905290 Reviewed-by: Marja Hölttä <marja@chromium.org> Reviewed-by: Toon Verwaest <verwaest@chromium.org> Commit-Queue: Joyee Cheung <joyee@igalia.com> Cr-Commit-Position: refs/heads/main@{#90833} Refs: v8/v8@efb1133 PR-URL: nodejs#51551 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
- Add support for --build-snapshot-config which allows passing snapshot configurations via a JSON configuration file. - Add support for node::SnapshotConfig in the embedder API The initial configurable options are: - "builder" (SnapshotConfig::builder_script_path): path to the builder script. - "withoutCodeCache" (SnapshotFlags::kWithoutCodeCache): disable code cache generation. PR-URL: #50453 Refs: #42566 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
The recently landed build-time user-land snapshot is related to packaging solutions (e.g. pkg, nexe) in that if the user puts all the resources (modules, assets) in the snapshot, the compiled binary is a single-executable containing a bundle of user code, similar to what these packaging solutions produce, only that
On the other hand, the user land snapshot we have right now is still a bit limited - a fair amount of builtins are not yet supported (pending more refactoring), and we still need to collect more user feedback to find states in builtins that might be out-of-sync with the system/native layer when being deserialized from the. snapshot. We also do not support user modules yet (the entry point must contain a bundle of all the modules that's needed by the app). In terms of user-experience, it might still be better to have some kind of tooling that allows users to load assets from the binary as if the assets are in the file system (i.e. virtual file system that packaging solutions provides).
I think that user snapshots in Node.js core is not a complete replacement of these packaging solutions (unless we decide to provide an "official" solution ourselves, but still packaging is different from just snapshotting), but rather it's something that packaging solutions can make use of (i.e. they can build a snapshot into the packaged binary too, while providing features like virtual file systems or compression of assets for a better user experience). So this is an issue to gather ideas and feedback, etc.
Refs: #42566
The text was updated successfully, but these errors were encountered: