DoorDash Jan 31, 2023

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

Critical Insight

By optimizing type identification, hashing strategy, and framework initialization timing, DoorDash reduced iOS app launch time by 60% total.

The third optimization involved a creative workaround to bypass dyld's module initializers while maintaining compile-time safety (something even dlopen couldn't provide).

About This Article

Problem

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().

Solution

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.

Impact

The framework optimization made app startup 36% faster. Combined with two other optimizations, DoorDash achieved a 60% overall reduction in iOS launch time.

Recent from DoorDash

Related Articles