Repository navigation
perf: lowers peak memory usage when using --changed on a large graph - #10866
Merged
Merged
Conversation
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
jszumski
marked this pull request as ready for review
August 3, 2026 23:51
Contributor
Author
|
CI failures seem to be existing issues on |
sheremet-va
requested changes
Aug 5, 2026
| } | ||
| } | ||
|
|
||
| return runningTests | ||
| } | ||
| const cachedExists = (filepath: string): boolean => { |
Member
There was a problem hiding this comment.
Seeing this, I wonder if we can reuse fsModuleCache cache somewhere here too 🤔
Not required for this PR, but worth considering
jszumski
force-pushed
the
changed-memory-usage
branch
from
August 5, 2026 13:09
7d783e3 to
f2811db
Compare
jszumski
force-pushed
the
changed-memory-usage
branch
from
August 5, 2026 13:22
f2811db to
fbede55
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
Lowers peak memory usage when using
--changedon an interconnected graph. In a large monorepo where poor test architecture makes them highly connected, machines with limited memory frequently see OOMs when computingvitest list --changed=<sha>:This change updates the specifications algorithm to more closely match how
watcher.tstraverses the graph, changing the complexity fromO(tests x modules)toO(modules).On the failing graph from above, the peak memory usage dropped from 16.94 GB down to 2.83 GB and wall time improved from 336s to 17s.
Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.