AI Briefing
KO

Reducing App Launch Time by 29% with Mergeable Libraries

·2025.01.07 18:44

Key point

By adopting Mergeable libraries, the 29CM iOS app reduced Cold Start time by 400 to 500ms.

Details

The 29CM Mobile Team measured app performance using Sentry and found that the iOS app's Cold Start was slow, at approximately 1.5 seconds at p50 and approximately 2.3 seconds at p90, and selected reducing app launch time as the first improvement task.

The app was structured using Tuist-based The Modular Architecture (TMA), and among more than 80 modules, the interface targets that other modules depended on were in the form of Dynamic library. After reviewing Apple's Reducing your app’s launch time documentation and the Mergeable libraries concept, the team decided that the right approach was to merge them like a Static library in Release while keeping build times the same as Dynamic library in Debug.

During the application process, they first set Mergeable libraries in Xcode 15 to Automatic, but the app crashed in Release builds. The reason was that indirect dependency libraries needed to be set to Manual instead of Automatic, and following the guidance in the related documentation, they changed the configuration method to resolve the issue.

For the Manual configuration, the following changes were applied to the Tuist configuration.

  • MERGED_BINARY_TYPE = Manual
  • MERGEABLE_LIBRARY = Yes, MAKE_MERGEABLE = Yes for the target targets to be merged
  • Added -Wl,-merge_framework,{library name} for indirect dependencies

They also checked the build results. In Debug, the executable file was small and debug.dylib along with several frameworks remained, but in Release, the team's own module libraries disappeared from the executable file and only open source libraries remained. The framework file size was also reduced from 185KB to 84KB, and it was confirmed that merged libraries remained only as shell files instead of actual code.

After applying this, according to Sentry aggregation, Mergeable libraries was reflected starting from version 6.39.0 and above, and although the sample count was not large, a clear performance improvement was observed. Cold Start improved by approximately 400 to 500ms, and Warm Start improved by approximately 180 to 250ms, and additionally, by using the -no_exported_symbols option, unnecessary symbol information was reduced and link time was further shortened.

This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.

Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.