Feature comparison: zccache vs sccache

July 24, 2026 ยท View on GitHub

This document is generated from docs/feature-matrix.yaml by ci/render_feature_matrix.py. To change a row, edit the YAML and re-run the renderer (uv run --with pyyaml python ci/render_feature_matrix.py). CI fails if this file is stale.

sccache claims are best-effort and sourced from the upstream README and docs at https://github.com/mozilla/sccache. When uncertain, a row is marked partial with a note rather than no.

Caching scope

FeaturezccachesccacheNotesEvidence
C/C++ object cachingyesyesCore feature of both caches; per-translation-unit .o caching.link
Link caching (artifact + sibling files)yesnozccache snapshots the output dir before the linker, captures sibling .pdb/.wasm/.map/runtime DLLs, restores them on hit.README.md#link-time-side-effects
Rust rustc caching (--emit=metadata, --emit=link, extern crate hashing)yesyesBoth wrap rustc. zccache adds extern-crate content hashing for cross-worktree sharing.link
Emscripten (emcc / em++)yesnozccache caches emcc/em++ end-to-end. sccache's README documents C/C++/Rust/CUDA but not Emscripten.link
wasm-ld linkingyesnoWebAssembly linking cached as part of zccache's link-caching path.README.md#link-time-side-effects
CUDA / nvccnoyessccache supports CUDA caching; zccache does not yet (out of current scope).link
MSVC cl.exe / link.exepartialyeszccache parses MSVC-style args and supports clang-cl; native cl.exe/link.exe integration is partial. sccache has first-class MSVC support.link
Multi-file compilation fast pathyesnoclang++ -c a.cpp b.cpp c.cpp โ€” per-file parallel cache lookups, only misses go to the compiler.README.md
Response file (.rsp) expansionyespartialzccache fully expands nested response files. sccache passes them through but does not deeply normalize them.README.md

Tool coverage

FeaturezccachesccacheNotesEvidence
clang-tidy (static analysis results cached)yesnoStatic analysis diagnostics cached per translation unit and replayed on hit.README.md
include-what-you-use (IWYU)yesnoIWYU output cached and replayed per translation unit.README.md
rustfmtyesnozccache routes rustfmt; recursive invocations always run so changed child modules cannot hide behind unchanged crate-root markers, while explicit skip_children=true invocations can use content markers. sccache caches rustc only.link
clippyyesnozccache caches clippy lint output. sccache caches rustc but not the lint pass.link
cargo check / cargo buildyesyesBoth work as RUSTC_WRAPPER for cargo check/cargo build.link

Build system integration

FeaturezccachesccacheNotesEvidence
Ninja (via CC / CXX launcher)yesyeslink
CMake (CMAKE_C_COMPILER_LAUNCHER)yesyeslink
Meson (native file)yesyes
Makeyesyes
RUSTC_WRAPPERyesyeslink
setuptools-rust / maturin / scikit-build-coreyesyesBoth work via standard CC/CXX/RUSTC_WRAPPER env injection.

Architecture

FeaturezccachesccacheNotesEvidence
Persistent daemon with sub-ms IPCyespartialzccache's daemon serves hits in ~1ms over a single IPC roundtrip. sccache has a server, but each call pays ~170ms (spawn + handshake + disk I/O).README.md#why-is-zccache-so-much-faster-on-warm-hits
Single-roundtrip IPC (length-prefixed bincode)yesnoOne length-prefixed bincode message per compile. sccache's protocol uses multiple subprocess invocations per call.link
Safe hardlink delivery on hityesnoCache hits use a capability-driven reflink, protected-hardlink, or copy ladder. sccache copies bytes back over IPC.README.md#why-is-zccache-so-much-faster-on-warm-hits
Reflink delivery (ReFS, btrfs/XFS, APFS)yesnozccache probes volume-pair capabilities and prefers true block-level COW while preserving stored mtimes.README.md#safe-filesystem-materialization
In-memory metadata cache (DashMap)yesnoFile sizes, mtimes, and content hashes live in a lock-free DashMap. Cache key computation is a memory lookup.README.md#why-is-zccache-so-much-faster-on-warm-hits
Filesystem watcher (notify-backed)yesnoBackground notify watcher tracks file changes in real time, so the daemon already knows whether inputs are dirty before compile is invoked.README.md#why-is-zccache-so-much-faster-on-warm-hits
Content-addressed artifact storeyesyesBoth hash-key cache entries by input content.link
Protocol versioning (wire-format bump policy)yespartialzccache embeds PROTOCOL_VERSION in every IPC frame and bumps it on any wire-format change. sccache versions its server but the policy is less explicit.link
Compile journal (JSONL diagnostics)yesnoEvery compile is recorded as secret-safe JSONL for diagnostics and partial replay; exact replay requires an independently captured trusted environment.docs/journal-schema.md
Session stats / per-build hit ratesyespartialsccache exposes lifetime --show-stats. zccache adds per-session/per-build hit rates over the daemon connection.link
Crash dumper (CLI + daemon)yesnozccache_core::crash::install captures structured crash dumps for both binaries.docs/architecture/runtime.md

Worktree / multi-checkout

FeaturezccachesccacheNotesEvidence
ZCCACHE_PATH_REMAP=auto cross-worktree sharingyesnoOne cache entry serves every worktree of the same repo. Hashes are computed against a canonical path; absolute paths are remapped on the fly.README.md
C/C++ -ffile-prefix-map injectionyesnozccache injects -ffile-prefix-map automatically so debug info points at the canonical path, not the worktree path.README.md
Rust --remap-path-prefix injectionyesnozccache injects --remap-path-prefix so rustc output is worktree-independent.README.md
Strict path validationyesno--strict-paths rejects cache entries with non-canonical paths instead of silently leaking worktree paths.README.md

Storage backends

FeaturezccachesccacheNotesEvidence
Local filesystemyesyesDefault backend in both caches.link
S3noyeszccache is local-first by design; remote backends are out of scope today.link
Google Cloud Storagenoyeslink
Redisnoyeslink
Memcachednoyeslink
Azure Blobnoyeslink
GitHub Actions Cache (native API client)yesyesBoth can persist to the GitHub Actions cache (zccache via zccache-gha, sccache via SCCACHE_GHA_ENABLED).link
Distributed scheduler / build farmnoyessccache has a dist-server build farm. zccache focuses on local-first warm-hit latency and does not ship a distributed scheduler.link

Platform / packaging

FeaturezccachesccacheNotesEvidence
Linux x86_64yesyes
Linux aarch64yesyes
macOS x86_64yesyes
macOS arm64 (Apple Silicon)yesyes
Windows x86_64yesyes
Windows arm64yespartialzccache ships native Windows arm64 wheels and binaries. sccache's release coverage of Windows arm64 is partial.link
Windows Defender exclusion helperyesnozccache defender-exclusions add excludes the cache root from Defender real-time scans, recovering minutes of wall-time on Windows.README.md#windows-defender-exclusions
PyPI wheelsyesnozccache ships native wheels per-platform; PyPI is the distribution channel. sccache distributes via crates.io and GitHub releases.link
crates.io publishingyesyesBoth publish to crates.io (zccache-cli / zccache-daemon / zccache-core vs sccache).link
GitHub Action (composite)yesyeszccache ships a composite action that replaces sccache-action + Swatinem/rust-cache. sccache is wired via mozilla-actions/sccache-action.link
Target snapshot caching + zccache warm backfillyesnozccache snapshots target/ and backfills the daemon cache on restore. sccache leaves target/ caching to Swatinem/rust-cache.README.md

Performance posture

FeaturezccachesccacheNotesEvidence
Per-hit costyespartialzccache serves hits in ~1ms (in-memory lookup + hardlink). sccache pays ~170ms per call (spawn + hash + IPC + disk I/O).README.md#why-is-zccache-so-much-faster-on-warm-hits
mtime preservation on hitsyespartialzccache preserves the cached artifact's mtime so cargo's incremental fingerprint doesn't invalidate downstream crates.CLAUDE.md
Compiler child priority (auto-throttle at 95% CPU)yesnozccache demotes compiler children when system CPU is saturated, keeping the host responsive during big rebuilds.README.md

Reliability

FeaturezccachesccacheNotesEvidence
Hardlink cache-poisoning prevention and detectionyespartialRead-only blobs, native-file-ID registry, mediated detach, and watcher-assisted suspect verification prevent silent poisoning.README.md#safe-filesystem-materialization