Skip to content

Research: Reduce Build Times with sccache #1726

Closed

Description

@josecelano

Goal

Research whether sccache is effective for this workspace in local development and on GitHub-hosted CI runners, and decide if it should be adopted fully, partially, or not at all.

This is an evidence-driven research issue. No workflow changes are assumed until benchmarks confirm a measurable benefit.

Background

A benchmark on 2026-05-01 shows a clean build takes ~142 s, of which ~89 % is compilation.

  • Swatinem/rust-cache appears ineffective at this workspace size (~9 GB target/; transfer cost exceeds compile time).
  • sccache caches individual codegen units by content hash, so a single changed crate does not bust the whole cache.

Known limitations to validate:

  • bin, dylib, cdylib, and proc-macro crates are never cached by sccache (the heaviest crate torrust-tracker is a bin).
  • Incremental compilation must be disabled (CARGO_INCREMENTAL=0).
  • GitHub-hosted runners are non-sticky; every run starts cold from remote cache.

The full issue spec, benchmark data, and task breakdown are in docs/issues/<issue-number>-reduce-build-times-sccache/ in the repository.

Tasks

  1. Local A/B benchmark (baseline vs sccache, cold/warm/warm-after-change).
  2. Decide whether to enable sccache in .cargo/config.toml for developers.
  3. CI A/B benchmark on GitHub-hosted runners (first and repeat runs).
  4. Document recommendation: adopt, hybrid, or reject.

Activity

  1. added
    Needs Research
    Build | Project System
    on May 4, 2026
  2. added 4 commits that reference this issue on May 4, 2026
  3. josecelano commented on May 19, 2026

    @josecelano
    MemberAuthor
    Image
  4. added a commit that references this issue on May 27, 2026
  5. added a commit that references this issue on Jun 1, 2026
  6. self-assigned this
    on Jun 1, 2026
  7. added a commit that references this issue on Jun 14, 2026
  8. josecelano commented on Jun 14, 2026

    @josecelano
    MemberAuthor

    Closed via #1905

  9. added 2 commits that reference this issue on Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Build | Project SystemNeeds Research

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions