{"id":18549,"date":"2017-08-04T14:42:17","date_gmt":"2017-08-04T18:42:17","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=18549"},"modified":"2025-07-08T21:53:26","modified_gmt":"2025-07-09T01:53:26","slug":"using-static-frameworks-to-speed-up-launching","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2017\/08\/04\/using-static-frameworks-to-speed-up-launching\/","title":{"rendered":"Using Static Frameworks to Speed Up Launching"},"content":{"rendered":"<p><a href=\"https:\/\/blog.automatic.com\/how-we-cut-our-ios-apps-launch-time-in-half-with-this-one-cool-trick-7aca2011e2ea\">Eric Horacek<\/a> (via <a href=\"https:\/\/twitter.com\/ljuba\/status\/880900559976374272\">Ljuba Miljkovic<\/a>):<\/p>\n<blockquote cite=\"https:\/\/blog.automatic.com\/how-we-cut-our-ios-apps-launch-time-in-half-with-this-one-cool-trick-7aca2011e2ea\"><p>This slowdown happens because every dynamic framework adds overhead for <a href=\"https:\/\/www.mikeash.com\/pyblog\/friday-qa-2012-11-09-dyld-dynamic-linking-on-os-x.html\">dyld<\/a> to do before an app&rsquo;s <code>main()<\/code> function is called (known as &ldquo;loading, rebasing, and binding&rdquo;). In this <a href=\"https:\/\/developer.apple.com\/videos\/play\/wwdc2016\/406\/\">WWDC 2016 talk<\/a>, Apple suggests replacing dynamic frameworks with static archives to mitigate this. To take this approach, we rebuilt as many of our dynamic frameworks as possible statically and then merged them into a single monolithic dynamic framework named AutomaticCore.<\/p><p>[&#8230;]<\/p><p>Apple wasn&rsquo;t exaggerating when they said too many dynamic frameworks could slow down your app&rsquo;s launch time. However, merging our dynamic frameworks wasn&rsquo;t trivial: we had to rework our development workflow to build our app this way from now on.<\/p><p>[&#8230;]<\/p><p>It was not trivial to add support to Carthage for building static <em>archives<\/em> (<code>.a<\/code> files). However, with some <a href=\"https:\/\/github.com\/Carthage\/Carthage\/pull\/1932\">minimal changes<\/a>, we were able to update Carthage to support building static <em>frameworks<\/em> (<code>.framework<\/code> files). Static frameworks are just like static archives, but packaged differently. They have a similar structure to dynamic frameworks, but with a static <a href=\"https:\/\/developer.apple.com\/library\/content\/documentation\/DeveloperTools\/Conceptual\/MachOTopics\/1-Articles\/building_files.html\">Mach-O<\/a> file in place of a dynamic one.<\/p><p>[&#8230;]<\/p><p>However, unlike dynamic frameworks, static frameworks are not embedded&mdash;meaning we needed to do some extra legwork to make their resources available.<\/p><\/blockquote>\n\n<p>See also: <a href=\"https:\/\/developer.apple.com\/videos\/play\/wwdc2017\/413\/\">App Startup Time: Past, Present, and Future<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Eric Horacek (via Ljuba Miljkovic): This slowdown happens because every dynamic framework adds overhead for dyld to do before an app&rsquo;s main() function is called (known as &ldquo;loading, rebasing, and binding&rdquo;). In this WWDC 2016 talk, Apple suggests replacing dynamic frameworks with static archives to mitigate this. To take this approach, we rebuilt as many [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2025-07-09T01:53:28Z","apple_news_api_id":"42ea48dd-8250-4119-ad69-c0d6fe680cb1","apple_news_api_modified_at":"2025-07-09T01:53:28Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/AQupI3YJQQRmtacDW_mgMsQ","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[205,31,26,2792,54,138,71,901],"class_list":["post-18549","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-dyld","tag-ios","tag-iosapp","tag-mach-o","tag-objective-c","tag-optimization","tag-programming","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/18549","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=18549"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/18549\/revisions"}],"predecessor-version":[{"id":18550,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/18549\/revisions\/18550"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=18549"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=18549"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=18549"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}