perf: Reduce per-package hashing overhead and eliminate SCM subprocesses#11942
Merged
anthonyshew merged 2 commits intomainfrom Feb 20, 2026
Merged
perf: Reduce per-package hashing overhead and eliminate SCM subprocesses#11942anthonyshew merged 2 commits intomainfrom
anthonyshew merged 2 commits intomainfrom
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Coverage Report
|
Contributor
Author
|
The tests that are failing are flakes. Merging past. |
github-actions bot
added a commit
that referenced
this pull request
Feb 20, 2026
## Release v2.8.11-canary.16 Versioned docs: https://v2-8-11-canary-16.turborepo.dev ### Changes - release(turborepo): 2.8.11-canary.15 (#11943) (`ef6dfd2`) - perf: Reduce per-package hashing overhead and eliminate SCM subprocesses (#11942) (`fc19b66`) --------- 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
Follow-up to #11938. Targets the per-package hashing hot path that dominates at scale, plus eliminates the last two git subprocesses from
--dryruns.Small repo (~6 packages)
Medium repo (~120 packages)
Large repo (~1000 packages)
The small repo results best isolate the fixed-cost improvements (git2 for branch/SHA, reduced allocation overhead) since per-package work is minimal. At larger scales, the improvements are present but within noise because wall-clock time is already well-parallelized across rayon threads.
Benchmarks
All benchmarks:
turbo run <task> --skip-infer --dry, 5 warmup + 10 measured runs, release build.Changes
FileHashes: HashMap to sorted Vec —
FileHashesinner type changed fromHashMapto pre-sortedVec. Eliminates HashMap construction (hashing, bucket allocation, rehashing) in the per-package hashing pipeline and removes redundant re-sorting in Cap'n Proto serialization. The sort happens once at the construction boundary; downstream consumers (expanded_inputs,.hash()) get pre-sorted data for free.Status entry binary search —
get_package_hashesnow usespartition_pointon pre-sorted status entries instead of a linear scan. Reduces per-package status lookup from O(dirty_files) to O(log(dirty_files) + matched). Also addswith_capacityto the per-package HashMap to avoid rehashing.git2 for branch/SHA —
get_current_branchandget_current_sha(called bySCMState::getinto_summary) now usegit2::Repositoryinstead of forkinggit branch --show-currentandgit rev-parse HEAD. Gated behind#[cfg(feature = "git2")]with subprocess fallback.