Strava Kyle Ryan Jan 24, 2023

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

Critical Insight

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.

The team discovered one anti-pattern in their deep linking system that was silently killing performance across the entire app.

About This Article

Problem

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.

Solution

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.

Impact

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.