Skip to content

perf(zccache): firmware compiles don't hit zccache cross-project even when args are workspace-relative #966

Description

@zackees

Context

Follow-up to #952 / PR #965. After making ESP32 fw-libs compiles workspace-relative (source/-o/-I relativized, cwd = workspace — the same treatment sketch/core already get), the #942 harness shows only a modest warm improvement (fw-libs 185s → 141s), not the expected drop to seconds.

Measuring a clean cold→warm in one container run (fresh ~/.fbuild before cold, fresh project copy for warm), none of the firmware phases hit the cache cross-project:

  • warm compile-sketch ≈ 80 s (not a hit)
  • warm compile-core-variant ≈ 10 s (not a hit)
  • warm fw-libs ≈ 141 s (partial at best)

So the premise "sketch/core hit cross-project, make fw-libs like them" is only half true: sketch/core are workspace-relative but still don't reliably hit zccache across two project directories in a clean run. Workspace-relative args are necessary but not sufficient.

Investigate

  • Does the embedded zccache key include the absolute compile CWD (or another project-specific input) in addition to the relativized args? If so, cross-project hits are impossible regardless of arg relativization.
  • Does the embedded zccache persist its object store across builds within a container run at all, and where (~/.fbuild/<mode>/zccache/ vs the soldr-managed store)?
  • Instrument the per-TU zccache lookup key for one sketch source across /tmp/nds (cold) and /tmp/nds2 (warm) and diff the exact differing component.

Acceptance criteria

  • A clean cold→warm run shows warm compile-sketch, compile-core-variant, and fw-libs hitting zccache (sub-second / near-copy).
  • Root cause (the project-specific key input) documented.
  • Warm total drops toward config-parse + link once the compile phases hit.

Decisions

Part of #942. Follow-up to #952 / PR #965.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions