turbo
f01afa9a - perf: Reuse archive anchor during cache creation (#14010)

Commit
8 days ago
perf: Reuse archive anchor during cache creation (#14010) Fixes TURBO-5987 Reuse one verified cache-archive root descriptor and canonical root path across all entries in a `CacheWriter`. Child components continue to use the existing `openat`/`O_NOFOLLOW` traversal and internal-symlink validation. ## Performance Measured an end-to-end local cache miss for a no-op task with 10,000 existing tiny outputs under a depth-5 directory. Each sample removed `.turbo`, ran the release-profile Turbo binary with `--daemon=false`, and wrote a fresh local cache archive. The generated fixture and benchmark artifacts remained outside the repository. `hyperfine 1.19.0`, 3 warmups and 5 measured samples per binary in each of four balanced AB/BA blocks (20 samples per binary), Apple M4 Max, 36 GiB RAM, macOS, `rustc 1.98.0-nightly`. | Metric | Before | After | Improvement | | --- | ---: | ---: | ---: | | Pooled median save latency | 1,499.00 ms | 1,393.81 ms | 7.02% | | Sample standard deviation | 20.84 ms | 18.29 ms | 12.2% lower | | Block 1 median | 1,507.20 ms | 1,410.39 ms | 6.42% | | Block 2 median | 1,494.84 ms | 1,388.85 ms | 7.09% | | Block 3 median | 1,481.27 ms | 1,393.04 ms | 5.96% | | Block 4 median | 1,498.18 ms | 1,394.59 ms | 6.91% | Command: ```sh hyperfine --warmup 3 --runs 5 --prepare 'rm -rf .turbo' \ '/tmp/turbo-baseline run build --daemon=false --no-update-notifier >/dev/null' \ '/tmp/turbo-candidate run build --daemon=false --no-update-notifier >/dev/null' ``` The candidate improved in every command order and every block. This workload isolates the many-file archive-save case; it does not claim the same percentage for cache restores or large individual files.
Author
Parents
Loading