perf: Eliminate redundant syscalls in FSCache fetch and exists#11985
Merged
anthonyshew merged 1 commit intomainfrom Feb 24, 2026
Merged
perf: Eliminate redundant syscalls in FSCache fetch and exists#11985anthonyshew merged 1 commit intomainfrom
anthonyshew merged 1 commit intomainfrom
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
In fetch(), replace the exists() + open() two-step with a single open() attempt. Drop the legacy uncompressed .tar fallback — put() has written .tar.zst exclusively since the Go-to-Rust port in 2023. In exists(), check only .tar.zst. This reduces cache hits from 3 syscalls to 1, and cache misses from 2 syscalls to 1.
84385c9 to
3486022
Compare
Contributor
Coverage Report
|
anthonyshew
added a commit
that referenced
this pull request
Feb 25, 2026
## Release v2.8.11-canary.28 > [!NOTE] > This release PR was created manually because the [automated release workflow failed](https://github.com/vercel/turborepo/actions/runs/22396672874/job/64834751381) during the "Create Release PR" step. The npm packages were already published successfully. ### Changes - release(turborepo): 2.8.11-canary.27 (#11975) (`09e2557`) - chore: Move git hooks from pre-commit to pre-push and match CI lint checks (#11977) (`68928c0`) - chore: Update AGENTS.md (#11978) (`3887e0d`) - fix: Use correct pnpm version in library release workflow (#11979) (`716229d`) - fix: Fix library release workflow for Trusted Publishing OIDC (#11980) (`f2b57af`) - fix: Use repo setup-node action in library release package job (#11981) (`c8d6fd8`) - fix: Add repository field to @turbo/repository package.json (#11982) (`2865110`) - perf: Replace heap-allocated String with stack-allocated OidHash for git OIDs (#11984) (`24e1937`) - perf: Eliminate redundant syscalls in FSCache fetch and exists (#11985) (`ba1e3bb`) - release(library): 0.0.1-canary.19 (#11983) (`a5bc714`) - perf: Reduce per-task allocations in visitor dispatch loop (#11986) (`53b2b4f`) - docs: Fix same-page anchor links that don't scroll to target (#11989) (`b1d5ec2`) - docs: Mention inputs key in package hash inputs table (#11990) (`6bc216b`) - fix(docs): update sitemap.md to single-line pipe-delimited format (#11976) (`fd15d24`) - fix: Disable husky pre-push hook during release staging (#11991) (`2365307`) - fix: Disable husky pre-push hook in release workflow (#11992) (`71ca25c`)
github-actions Bot
added a commit
that referenced
this pull request
Feb 25, 2026
## Release v2.8.11-canary.29 Versioned docs: https://v2-8-11-canary-29.turborepo.dev ### Changes - release(turborepo): 2.8.11-canary.27 (#11975) (`09e2557`) - chore: Move git hooks from pre-commit to pre-push and match CI lint checks (#11977) (`68928c0`) - chore: Update AGENTS.md (#11978) (`3887e0d`) - fix: Use correct pnpm version in library release workflow (#11979) (`716229d`) - fix: Fix library release workflow for Trusted Publishing OIDC (#11980) (`f2b57af`) - fix: Use repo setup-node action in library release package job (#11981) (`c8d6fd8`) - fix: Add repository field to @turbo/repository package.json (#11982) (`2865110`) - perf: Replace heap-allocated String with stack-allocated OidHash for git OIDs (#11984) (`24e1937`) - perf: Eliminate redundant syscalls in FSCache fetch and exists (#11985) (`ba1e3bb`) - release(library): 0.0.1-canary.19 (#11983) (`a5bc714`) - perf: Reduce per-task allocations in visitor dispatch loop (#11986) (`53b2b4f`) - docs: Fix same-page anchor links that don't scroll to target (#11989) (`b1d5ec2`) - docs: Mention inputs key in package hash inputs table (#11990) (`6bc216b`) - fix(docs): update sitemap.md to single-line pipe-delimited format (#11976) (`fd15d24`) - fix: Disable husky pre-push hook during release staging (#11991) (`2365307`) - fix: Disable husky pre-push hook in release workflow (#11992) (`71ca25c`) - release(turborepo): 2.8.11-canary.28 (#11993) (`5793b0a`) - fix: Use versioned schema URLs in Turborepo skill files (#11994) (`7e48e24`) --------- 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
fetch(), replace theexists()+CacheReader::open()two-step with a singleopen()attempt — 1 syscall instead of 3 on cache hits.tarfallback from bothfetch()andexists()—put()has written.tar.zstexclusively since the Go-to-Rust port in mid-2023Profile data for the large repo shows
fetchself-time dropped from 200.5ms (11.8%) to 129.6ms (8.0%) — a 35% reduction across 962 calls.Benchmarks run on a Linux sandbox with hyperfine (15 runs, 2 warmup), all cache-hit scenarios.
Why
Every
fetch()call was doing:stat(.tar)→ ENOENT →stat(.tar.zst)→ OK →open(.tar.zst)— 3 syscalls. The new flow isopen(.tar.zst)→ done. The uncompressed.tarpath was a fallback for artifacts from the Go era (~2021-2022). No modern Turborepo version writes uncompressed cache artifacts, and cache entries rotate out constantly.