Build Time Optimizations in Xcode
Article Summary
Swiggy's iOS team cut build times by 21% and saved developers hours of waiting. Here's their battle-tested playbook.
Dhruvil Patel from Swiggy's mobile team breaks down their systematic approach to tackling slow Xcode builds. They analyzed compilation bottlenecks, optimized code patterns, and tweaked build settings to dramatically improve developer productivity.
Key Takeaways
- Code signing optimization alone reduced incremental builds by 50% using SHA-1 hashing
- Pod dependency flags saved 40 seconds per build across debug configurations
- Swift compiler flags identified functions taking over 100ms to compile
- XCLogParser tool revealed slowest targets and files across all modules
- Simple changes like final classes and explicit types reduced compilation overhead
A 21% build time reduction came from systematic measurement, targeted code improvements, and smart build setting adjustments.
About This Article
At Swiggy, Dhruvil Patel's team noticed that incremental builds were taking too long. Code signing operations were hashing resources unnecessarily, even when the code hadn't changed at all.
The team switched from SHA-256 hashing to the faster SHA-1 algorithm. They also created an empty resourceRules.plist file to cut down on the content that needed signature verification.
This code signing optimization cut incremental build times in half. It shows how focused changes to the build system can have real performance benefits.