Skip to content

perf(vm): let environments opt out of the module graph prewarm - #11078

Merged
sheremet-va merged 1 commit into
mainfrom
perf/vm-prewarm-opt-out
Aug 28, 2026
Merged

perf(vm): let environments opt out of the module graph prewarm#11078
sheremet-va merged 1 commit into
mainfrom
perf/vm-prewarm-opt-out

Conversation

@sheremet-va

@sheremet-va sheremet-va commented Aug 27, 2026

Copy link
Copy Markdown
Member

The vm pool prewarm from #10744 only pays off while the server is idle during a slow setupVM (jsdom, happy-dom). With the node environment there is no such window, so the walk competes with the worker's own fetches: on the benchmarks' micro-utils app (5 files) warm vmThreads went from 0.27s on 4.1.10 to 0.33s, node-library from 0.53s to 0.55s.

Adds prewarmModules?: boolean to Environment (default true) and sets it to false on the built-in node environment. Custom environments with a cheap setupVM can opt out the same way.

Warm medians on micro-utils after the change, 4.1.10 vs this PR: vmThreads 0.28s vs 0.28s, vmForks 0.29s vs 0.29s, vmThreads + jsdom 0.61s vs 0.56s (prewarm still on). node-library vmThreads 0.53s vs 0.49s.

@netlify

netlify Bot commented Aug 27, 2026

Copy link
Copy Markdown

Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit 30e4a5a
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/6a905c5df3737c0008bb703f
😎 Deploy Preview https://deploy-preview-11078--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@sheremet-va

Copy link
Copy Markdown
Member Author

@hi-ogawa you were right!

@sheremet-va
sheremet-va merged commit a6d5ea2 into main Aug 28, 2026
29 of 31 checks passed
@sheremet-va
sheremet-va deleted the perf/vm-prewarm-opt-out branch August 28, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants