perf: Parallelize and pre-build RepoGitIndex#11889
Merged
anthonyshew merged 2 commits intomainfrom Feb 17, 2026
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Coverage Report
|
github-actions Bot
added a commit
that referenced
this pull request
Feb 17, 2026
## Release v2.8.10-canary.8 Versioned docs: https://v2-8-10-canary-8.turborepo.dev ### Changes - release(turborepo): 2.8.10-canary.7 (#11888) (`a4213a1`) - perf: Parallelize and pre-build RepoGitIndex (#11889) (`5cbeef3`) --------- Co-authored-by: Turbobot <turbobot@vercel.com>
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
git ls-treeandgit statusinsideRepoGitIndex::newusingstd::thread::scopeRepoGitIndexeagerly on a background thread duringRunBuilder::build(), overlapping the git I/O with package graph constructioncalculate_file_hashesandget_internal_deps_hashinstead of each building their ownThese three git subprocess calls (
git ls-tree -r -z HEADandgit status -z) previously ran sequentially and only started after the package graph was fully constructed. They have no data dependency on the package graph — they only need the git binary path and repo root. By starting them earlier and running them in parallel, we hide the entire cost behind work that was already happening.Benchmarks
Tested with
--dryruns across three monorepos of varying sizes.Large monorepo (~hundreds of packages)
Medium monorepo (~100 packages)
Small monorepo (~6 packages)
The biggest win is in medium-sized repos where the git index build is a larger fraction of total runtime. Small repos fall below the index threshold and are unaffected. Large repos benefit in absolute terms (~163ms) but the percentage improvement is smaller since other work dominates.