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)
- 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.
- Stage 2 (follow-up): isolate
SLIC3R_VERSION similarly.
Expected after both: ~35% → ~85-95%.
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.hcontains 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)
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.SLIC3R_VERSIONsimilarly.Expected after both: ~35% → ~85-95%.