feat: enable V8 code cache for host-platform binaries#8
Merged
Conversation
When the build host is also a target platform, enable useCodeCache in the SEA config for that platform's binary. Code cache pre-compiles the JS into V8 bytecode at build time, saving ~15% startup time. Since code cache is CPU-architecture-specific, it can't be used for cross-compiled binaries. When building multiple targets that include the host platform, two blobs are generated: - Base blob (no code cache) for cross-compiled targets - Code-cache blob for the host platform binary When building for a single platform that matches the host (the common local-dev case), only one blob is generated with code cache enabled.
a6c9dd8 to
1ebbad3
Compare
This was referenced May 22, 2026
BYK
added a commit
to getsentry/cli
that referenced
this pull request
May 22, 2026
Updates fossilize to v0.6.0 which automatically enables V8 code cache for binaries matching the build host platform. **Impact:** The linux-x64 binary (built on ubuntu-latest in CI) gets ~15% faster startup (~740ms vs ~870ms) from pre-compiled V8 bytecode. Cross-compiled binaries (darwin, windows, linux-arm64) are unaffected — code cache is CPU-architecture-specific. See BYK/fossilize#8 for the fossilize change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When the build host is also a target platform, enable
useCodeCachein the SEA config for that platform's binary. V8 code cache pre-compiles the JS into bytecode at build time, saving ~15% startup time.Since code cache is CPU-architecture-specific, it can't be used for cross-compiled binaries. This PR handles all three scenarios:
Scenarios
--single)How it works
When cross-compiling multiple targets AND the host is one of them:
When building for a single platform that matches the host (common local-dev case), only one blob is generated with code cache enabled.
Benchmark (Sentry CLI, ~4MB CJS bundle, linux-x64)
~130ms / ~15% improvement with zero downsides for same-platform binaries.