How We Reduced Our iOS App Launch Time by 60%
Article Summary
Filip Busic from DoorDash reveals how three targeted optimizations slashed iOS app launch time by 60%. The culprits? String operations, hashing strategies, and sneaky third-party framework initializers.
DoorDash's iOS team tackled app startup performance with surgical precision, using performance profiling tools to identify bottlenecks that were costing them precious milliseconds. Their investigation uncovered three distinct optimization opportunities that each delivered double-digit performance gains.
Key Takeaways
- Replaced String(describing:) with ObjectIdentifier for 22% faster launch time
- Eliminated AnyHashable conversions for 29% improvement and 55% faster command execution
- Deferred third-party framework initializers by tricking dyld for 36% gain
By optimizing type identification, hashing strategy, and framework initialization timing, DoorDash reduced iOS app launch time by 60% total.
About This Article
DoorDash's iOS app was taking about 200ms to initialize a third-party framework during launch. This single framework consumed roughly 40% of the total startup time because dyld was calling nine module initializers before the app even reached main().
Filip Busic's team found a workaround by making dyld skip the module initializers. They disguised the framework section as a regular section, then manually triggered the initializers at runtime. The approach used dladdr with compile-time hash validation and runtime safety checks to keep things secure.
The framework optimization made app startup 36% faster. Combined with two other optimizations, DoorDash achieved a 60% overall reduction in iOS launch time.