Xcode Compilation Cache - Cache Hit Rate Calculation Improvement

Description

Improved Cache Hit Rate Calculation for Xcode Builds – We’ve refined how cache hit rate is measured for builds using the Bitrise Build Cache for Xcode, resulting in more meaningful and actionable insights.

Highlights:

  • Task-Based Hit Rate: Cache hit rate is now reported based on tasks as defined by the Xcode build system, giving you a clearer view of how much work is actually reused from cache.
  • Considers Local Compilation Cache: The new calculation includes both remote and local compilation cache hits—providing a comprehensive and realistic measure of your cache effectiveness.
  • Alignment with Gradle: This approach matches how cache hit rates are calculated in Gradle builds on Bitrise, bringing consistency across platforms and making your analytics easier to interpret.
  • Previously Traffic-Based: We previously calculated hit rate from cache server ingress/egress—tracking blobs exchanged between Bitrise and your builds. To learn more about these blobs, check out our blog post!
  • Comprehensive Analytics: The latest Build Cache CLI now logs detailed metrics for each invocation, including both task-based and blob-based hit rates, so you have complete transparency:
[Bitrise Analytics] Proxy blob stats: hits: 30067 (2.9 GB) / total: 30168 (99.67%)
[Bitrise Analytics] Proxy KV stats: hits: 10686 / total: 10787 (99.06%)
[Bitrise Analytics] Xcode task stats: hits: 4885 / total: 5008 (97.54%)
  • Updated Insights & Trends: Hit rate percentages shown in build details, the build cache tab, invocation details, invocation list, and Bitrise Insights now reflect the new calculation, so you might see updated trends and results.
  • Richer Build Cache Metrics: These changes make your cache hit metrics more intuitive, more complete, and closely tied to real-world developer workflows in Xcode and beyond.

Bottom line: With cache hit rates now task-based and including local compilation cache, Bitrise gives you analytics that truly reflect your Xcode build’s efficiency—just as you expect when analyzing your Gradle builds.