Xcode Build Performance Analyzer
Identifies slow compilation targets and provides optimization recommendations.
When to Use
- •User complains build is slow
- •User asks "why is my build taking so long?"
- •User wants to optimize build times
- •After running build with
-showBuildTimingSummary
Usage
Capturing Build Timing
Run your build with timing summary enabled:
bash
xcodebuild -scheme MyApp -showBuildTimingSummary build 2>&1 | tee build-timing.log
Analyzing Timing
bash
swift ~/.claude/plugins/xcode-dx-skills/skills/xcode-build-performance/scripts/extract-timing.swift build-timing.log
What Gets Analyzed
- •Target compilation times: Which modules take longest to build
- •Type checking time: Swift type inference bottlenecks
- •Incremental build efficiency: Cache hit rates
- •Slowest files: Individual files that take longest to compile
Common Optimization Suggestions
Slow Type Checking
- •Add explicit type annotations
- •Break complex expressions into smaller parts
- •Avoid deeply nested generics
Low Cache Hit Rate
- •Check for volatile build settings
- •Ensure derived data isn't being cleared
- •Look for timestamp-based invalidation
Large Modules
- •Split into smaller targets
- •Use incremental compilation
- •Consider module boundaries
Output Format
The script outputs JSON with:
- •
targets: Build times per target - •
slowest_files: Top files by compile time - •
type_check_time: Time spent in Swift type checking - •
cache_stats: Incremental build cache statistics - •
recommendations: Suggested optimizations