Striving for iOS App Performance
Article Summary
Strava's iOS app was slowing down as they scaled to 1 billion activities in 18 months. Their solution? A ruthless focus on "Time to Something Useful."
The Strava engineering team tackled app performance by measuring what matters most: how fast users see actual content after tapping the app icon. They overhauled their dependency injection, optimized API calls, and built robust instrumentation to catch regressions.
Key Takeaways
- Created TTSU metric: time from app tap to displaying feed content
- Migrated to Swift-based dependency injection, deferring graph initialization
- Started API requests early while other dependencies loaded in parallel
- Used OSSignpost, Time Profiler, and production analytics for measurement
- Removed anti-patterns like options dictionaries that instantiated unused dependencies
By auditing their dependency graph, optimizing injection timing, and instrumenting both dev and production builds, Strava exceeded their performance targets in just a few months.
About This Article
Strava's dependency graph grew exponentially as new teams added features. Classes were rarely audited for unused dependencies, which slowed down injection and increased app startup times.
Kyle Ryan's team replaced their four-year-old Objective-C dependency injection framework with a Swift-only alternative that defers initialization until objects are actually needed. They then refactored assemblies into three stages: app delegate, launch, and core. This approach ensured only necessary objects were loaded.
The team hit their performance targets within a few months. They removed external dependencies, reduced the application footprint, and achieved faster operating system launch times and smaller initial app download sizes.