Repository navigation
Generate compile caches for TypeScript bundles by default - #8339
Conversation
There was a problem hiding this comment.
Superseded by the review of
11eb9900.
This review, of b058f48e
✅ Approved — No issues found: the build changes are small and correct, and the new test checks that V8 accepts the cache for every JS module in both bundles.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
📋 Code Quality: ✅ LGTM
- The header paths and bundle constants match the existing
wd_js_bundleoutputs and how the runtime already uses them. gen_compile_cacheonly covers builtin and internal JS modules. The Python data modules are left out.- The
\u2026escape keeps the Vectorize source ASCII, so the legacy and UTF-8 loaders give the same source length. - The new test requires a non-empty cache for every source module, checks that the legacy and UTF-8 strings are equal, and asserts that V8 accepts the cache.
📝 Documentation: ✅ LGTM
No documentation issues. The new comment in the test describes the current behaviour.
Reviewed commit: b058f48e
b058f48 to
11eb990
Compare
There was a problem hiding this comment.
Superseded by the review of
cdcf9a13.
This review, of 11eb9900
✅ Approved — No issues found. The escape keeps the Vectorize source ASCII so V8 accepts its cache, the build changes are correct, and the test checks every JavaScript module in both bundles.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
📋 Code Quality: ✅ LGTM
The \u2026 escape in vectorize-api.ts keeps the source ASCII, so the legacy and UTF-8 loaders read the same source and V8 accepts the cache. The build changes match the existing bundle rules. For every JavaScript module in both bundles, the test checks that a cache exists, that the legacy and UTF-8 source strings are equal, and that V8 accepts the cache.
📝 Documentation: ✅ LGTM
The new comments describe the current behaviour.
Reviewed commit: 11eb9900
There was a problem hiding this comment.
Superseded by the review of
11eb9900.
This review, of cdcf9a13
✅ Approved — No issues found. The new commit only sets the encoding smoke benchmark and the WebSocket kill-switch test to size large, which matches nearby targets. The earlier compile-cache changes are unchanged and still correct.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
📋 Code Quality: ✅ LGTM
src/bench/streams/encoding/BUILD.bazel: encoding-cpp now uses size = "large", the same as its sibling encoding-ts. wd_bench passes size through to the @smoke test targets.
src/workerd/api/tests/BUILD.bazel: the kill-switch wd_test now uses size = "large", like the websocket-accept-limit-test target just above it. wd_test does read size, and the added comment explains why the test needs it.
The compile-cache changes have not changed since the last review and are still correct. The \u2026 escape keeps the Vectorize source ASCII, so V8 accepts its cache, and the test checks every JavaScript module in both bundles.
📝 Documentation: ✅ LGTM
The new comments describe how the code works now.
Reviewed commit: cdcf9a13
cdcf9a1 to
11eb990
Compare
There was a problem hiding this comment.
Superseded by the review of
cd47d1ca.
This review, of 11eb9900
✅ Approved — No issues found: the compile caches are enabled with the existing bundle rules, the escape keeps the Vectorize source ASCII, and the new test checks that V8 accepts the cache for every JavaScript module in both bundles.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
📋 Code Quality: ✅ LGTM
- Build changes:
gen_compile_cache = Trueis forwarded correctly bywd_ts_bundlefor both bundles, and the new test dependencies point at public targets. - Vectorize source: the
\u2026escape keeps the source ASCII, so the legacy and UTF-8 loaders build identical source strings. - Test: for every JavaScript module in both bundles, it requires a cache, compares the legacy and UTF-8 source strings, and asserts that V8 does not reject the cache.
📝 Documentation: ✅ LGTM
The new comments describe how the code works now.
Reviewed commit: 11eb9900
Builtin TypeScript bundles ship fixed source with the executable, but omitting gen_compile_cache leaves them to compile that source at runtime. Enable cache generation by default in wd_ts_bundle and remove Node's redundant explicit setting. Keep wd_js_bundle opt-in so separately distributed Pyodide runtime bundles do not embed caches tied to an unrelated V8 build and flags. Require caches for every JavaScript module in the Cloudflare and static Pyodide bundles, check agreement between one-byte and UTF-8 sources, and verify that V8 accepts each serialized module.
b632fd3 to
cd47d1c
Compare
There was a problem hiding this comment.
✅ Approved — No findings: the default is moved into wd_ts_bundle correctly, wd_js_bundle stays opt-in, and the new test checks that every source module in the Cloudflare and static Pyodide bundles has a cache that V8 accepts.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
📋 Code Quality: ✅ LGTM
- Default change:
build/wd_ts_bundle.bzlnow defaultsgen_compile_cachetoTrueand passes it on towd_js_bundle, which still defaults toFalse. Node's build is unchanged now thatsrc/node/BUILD.bazeldrops its explicit setting, and the Cloudflare and static Pyodide bundles now get caches. - Test dependencies:
//src/cloudflareand//src/pyodide:pyodide_staticare public targets, and theCLOUDFLARE_BUNDLE/PYODIDE_BUNDLEconstants are included the same way elsewhere in the code. - Test: the test covers only
SRCmodules, which are the only modules that get caches. For each one it requires a cache, checks that the one-byte and UTF-8 source strings are equal, and asserts that V8 does not reject the cache. It also requires at least one checked module per bundle.
📝 Documentation: ✅ LGTM
The new comments describe how the code works now.
Reviewed commit: cd47d1ca
Builtin TypeScript modules should load V8 compile caches generated with the executable's V8 build and flags. The bundle rule currently defaults cache generation off, so Cloudflare and static Pyodide modules compile their fixed source at runtime unless each caller opts in.
Make
wd_ts_bundle()default togen_compile_cache = Trueand remove Node's redundant explicit setting. Existing module loaders prefer embedded caches and retain source compilation as V8's rejection fallback. The lower-levelwd_js_bundle()rule remains opt-in, preserving the separately distributed Pyodide runtime bundle: its artifact identity does not identify the consuming executable's V8 build and flags.Require an embedded cache for every JavaScript module in the Cloudflare and static Pyodide bundles, compare one-byte and UTF-8 source strings, and verify V8 accepts each serialized module. Existing encoding-fixture and runtime cache-consumption checks remain covered.
The additional cache bytes grow the executable. Cache generation retains lazy compilation, and each isolate still deserializes its own bytecode.