Skip to content

tests: opt-in ccache support#1529

Merged
jpnurmi merged 1 commit into
masterfrom
jpnurmi/test/ccache
Feb 23, 2026
Merged

tests: opt-in ccache support#1529
jpnurmi merged 1 commit into
masterfrom
jpnurmi/test/ccache

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Feb 18, 2026

Copy link
Copy Markdown
Collaborator

Adds opt-in ccache support for test builds. When USE_CCACHE=1 is set, cmake is configured to use ccache as the compiler launcher. The ccache environment is set up so that the cache is shared across pytest runs despite each run building in a new temp directory. With the compiler cache, test suite wall time is reduced by roughly 30-40%.

Usage

USE_CCACHE=1 pytest tests/ -v

Benchmark

Without ccache (baseline):

USE_CCACHE=1 pytest tests -v  240.43s user 141.85s system 173% cpu 3:40.59 total

First run with ccache:

real    4m33.000s

Cacheable calls:   3414 /  3414 (100.0%)
  Hits:            3005 /  3414 (88.02%)
  Misses:           409 /  3414 (11.98%)

Second run with ccache:

USE_CCACHE=1 pytest tests -v  103.13s user 91.25s system 99% cpu 3:15.54 total

Cacheable calls:   3414 /  3414 (100.0%)
  Hits:            3413 /  3414 (99.97%)
  Misses:             1 /  3414 ( 0.03%)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jpnurmi jpnurmi requested a review from supervacuus February 23, 2026 12:27
@jpnurmi jpnurmi merged commit b0142e4 into master Feb 23, 2026
46 checks passed
@jpnurmi jpnurmi deleted the jpnurmi/test/ccache branch February 23, 2026 15:08
BernhardMarconato pushed a commit to elgatosf/sentry-native that referenced this pull request Apr 21, 2026
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants