Skip to content

Enable compilation caching and eager linking for faster builds#5740

Open
AvdLee wants to merge 1 commit intowikimedia:mainfrom
AvdLee:build-performance-optimizations
Open

Enable compilation caching and eager linking for faster builds#5740
AvdLee wants to merge 1 commit intowikimedia:mainfrom
AvdLee:build-performance-optimizations

Conversation

@AvdLee
Copy link
Copy Markdown

@AvdLee AvdLee commented Mar 23, 2026

Summary

This PR enables recommended Xcode build settings to improve build performance for the Wikipedia iOS app.

Changes

  • COMPILATION_CACHING = YES (Debug + Release): Caches compilation results so repeated builds of unchanged sources are served from cache. The biggest wins come from branch switching, pulling changes, and CI builds where many files remain unchanged between builds.
  • EAGER_LINKING = YES (Debug): Allows the linker to start work before all compilation tasks finish, reducing wall-clock build time during development.

Benchmark (Xcode 26.2, Apple Silicon, 1,154 Swift files)

Metric Before After
Clean build 48.7s 46.5s
Cached clean -- 45.0s
Zero-change 12.9s 12.2s

Cached clean = clean build with a warm compilation cache. This is the realistic scenario for branch switching, pulling changes, or Clean Build Folder. The compilation cache lives outside DerivedData and survives product deletion.

How these were found

Analysis was performed using Xcode Build Optimization Agent Skills (note: still private, will be available soon. Happy to invite!), which benchmarks builds, audits project settings against best practices, and identifies optimization opportunities.

Test plan

  • Project builds successfully with all changes
  • Build settings verified via xcodebuild -showBuildSettings
  • Benchmarked before and after changes (3 runs each, medians reported)

Enable recommended Xcode build settings to improve build performance:

- COMPILATION_CACHING = YES (Debug + Release): caches compilation
  results so repeated builds of unchanged sources are served from
  cache. Benefits branch switching, pulling changes, and CI builds.
- EAGER_LINKING = YES (Debug): allows the linker to start before
  all compilation tasks finish, reducing wall-clock build time.

Benchmark (Xcode 26.2, Apple Silicon, 1,154 Swift files):
- Clean build: 48.7s → 46.5s
- Cached clean: 45.0s (warm compilation cache)
- Zero-change: 12.9s → 12.2s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant