Skip to content

perf(espidf): decide caching for delegated IDF builds (zccache launcher vs documented cold-only) #1974

Closed

Description

@zackees

Follow-up 5 of 5 from the merged research pass in #1761 (design note: docs/design/bare-idf-component-builds.md).

Why

The native ESP32 path gets zccache for free because fbuild drives the compiler itself. A delegated idf.py build drives gcc from ninja, so zccache is lost by default — every delegated build would pay the measured cold cost (50.3 s for a two-component esp32s3 app) with no warm path, while the surrounding project still reports fast warm builds for the Arduino path. That asymmetry has to be a decision with a number attached, not a surprise.

Scope

Two options, one decision:

  1. Compiler wrapper: inject CMAKE_C_COMPILER_LAUNCHER/CMAKE_CXX_COMPILER_LAUNCHER (or the RULE_LAUNCH_COMPILE equivalent for ninja rules IDF overrides) to route through zccache (the embedded crate, Set ZCCACHE_MODE explicitly before upgrading to zccache 1.15.0 (AUTO stops hardlinking → perf regression) #1565 family), and measure the warm no-op and one-file-touch deltas.
  2. Cold-only, documented: no wrapper; the delegated path is declared cold-only with its own metric and a warning, so nobody reads the Arduino warm numbers as applying to it.

Whichever is chosen: record the measurement in the design note and state the choice in the idf-cmake summary/telemetry so a slow build is explained rather than investigated.

Acceptance criteria

  • A measured warm/no-op comparison on the spike project (wrapper hit vs no wrapper), with wall-clock numbers in the plan/design note — not an estimate.
  • The decision is implemented, not just written: either the launcher wiring plus a test that the generated ninja invocation carries the wrapper, or an explicit cold-only marker in the delegated build report.
  • A test asserts the chosen mode is what the build summary claims (no "cached" claim on an unwrapped build).
  • If the wrapper is chosen, its cache key covers IDF version + sdkconfig digest (a sdkconfig change must not hit a stale object).
  • du/wall numbers recorded next to the existing spike table so the note stays the single source of truth.

Non-goals

  • No change to the Arduino-on-IDF caching path; no new CI lane until the measurement exists.

Depends on: #1971 (follow-up 2) — needs a delegating path to measure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions