Conversation
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.
Motivation
vmThreadsalready reuses bounded V8 compilation metadata for setup files, but test entries do not enable the same cache. Because the entry loader propagates this option into shared chunks, large isolated suites repeatedly parse the same ESM dependency chunks in fresh VM contexts.On a 290-file / 1,536-test jsdom shard, tracing attributed 20.39s of aggregate collection time to constructing 3,887 dependency
SourceTextModules. Enabling the existing cache reduced that work to 2.66s while preserving a fresh context, module graph, and evaluation for every file.Changes
Enable
cacheCompilationwhen loading test entries in VM pools, matching setup-file loading. This reuses only V8 parse/compile metadata through the existing bounded worker cache; module instances and state remain file-isolated.Paired untraced runs showed a conservative ~6% wall-time improvement. On current
main, three interleaved controls were 19.1s, 19.1s, and 19.2s; the final patched pair was 17.4s and 17.3s. An earlier patched run was a 25.1s cold/machine outlier, followed by 18.8s, so the PR does not claim the best-case 9.3% universally.Validation:
Browser mode and adapters are unaffected because this option is consumed only by the Node VM loaders.