Comprehensive Guide to iOS App Startup Optimization for Sohu Video
This article details a ten‑month iOS startup optimization project for the Sohu Video app, describing measurement methods, ten technical improvements—including dynamic‑to‑static library conversion, load‑method refactoring, binary reordering, and double‑root view architecture—that together reduced launch time by roughly 46% and provides practical code snippets and performance data.
In early 2021 the Sohu Video iOS team launched a ten‑month startup optimization effort that cut the app's launch time from the 2‑second range to about 1 second, a 46% reduction, by applying a series of systematic performance improvements.
Measuring launch time was performed with Xcode Instruments (flame graphs) and a custom tool called HHTimeProfile , which records per‑function execution times to 0.1 ms precision and generates flame graphs for both the pre‑main and didFinishLaunching phases.
Pre‑main phase optimizations included:
Converting 19 third‑party dynamic libraries to static libraries (using use_frameworks! :linkage => :static in the Podfile), reducing pre‑main latency by ~200 ms.
Removing ~450 redundant classes and categories, and eliminating unused SDKs.
Refactoring +load methods and C/C++ static initializers into explicit initialization code, saving 50‑100 ms.
Pre‑warming system dynamic libraries via a push‑notification extension, yielding a 20‑500 ms gain depending on device.
Binary reordering to colocate frequently called symbols, theoretically saving ~100 ms.
Prioritizing startup items and implementing a self‑registration mechanism using custom Mach‑O sections, cutting another ~200 ms.
Applying a time‑slicing strategy to split large tasks into smaller chunks, reducing perceived latency by ~200 ms.
Asynchronously fetching system settings (e.g., push‑notification flags), which lowered synchronous work by ~9 ms.
Adopting a double‑root view architecture to bypass unnecessary UI initialization when the app is launched via push, saving ~100 ms.
Data from real devices (iPhone 6 Plus, iPhone 7 Plus) showed average launch time reductions of 500 ms on older hardware and modest gains on newer models. Table examples illustrate the impact of push‑triggered launches versus normal launches.
Device
Normal Launch (ms)
Push Launch (ms)
iPhone 6 Plus
2307
1792
iPhone 7 Plus
631
574.5
The article concludes that launch speed is critical for user retention—each second of delay can cost ~7% of users—and that continuous profiling, incremental improvements, and monitoring (dashboards, daily reports) are essential to maintain a healthy startup performance as iOS evolves.
Sohu Tech Products
A knowledge-sharing platform for Sohu's technology products. As a leading Chinese internet brand with media, video, search, and gaming services and over 700 million users, Sohu continuously drives tech innovation and practice. We’ll share practical insights and tech news here.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.