Skip to content

ccache ~35% capped: volatile SLIC3R_BUILD_TIME/VERSION in widely-included header invalidates Direct-mode hits #469

Description

@BenJule

Root cause

ccache hit rate is capped at ~35% (Debian/Arch) / 9.5% (Fedora) regardless of compiler_check (content gave identical numbers to mtime). The real cause: libslic3r_version.h contains volatile values:

  • SLIC3R_BUILD_TIME — changes every build (timestamp)
  • SLIC3R_VERSION = 02.07.00.${BUILD_NUMBER} — changes every commit (git count)

This header is included via pchheader.hpp (PCH → all files) + libslic3r.h (69 .cpp). In Direct mode ccache hashes the header content → changes every build → invalidates all transitively dependent files (417 misses).

Fix (staged)

  1. This issue / stage 1: isolate SLIC3R_BUILD_TIME (only 3 real users: GUI_App, AboutDialog, LogSink) into its own narrow generated header so the widely-included version header stops changing per build. Proof-of-concept — measure hit rate.
  2. Stage 2 (follow-up): isolate SLIC3R_VERSION similarly.

Expected after both: ~35% → ~85-95%.

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions