{"id":12376,"date":"2015-09-24T09:19:11","date_gmt":"2015-09-24T13:19:11","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=12376"},"modified":"2016-02-12T14:10:43","modified_gmt":"2016-02-12T19:10:43","slug":"swift-2-bloat-in-the-twitter-app","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2015\/09\/24\/swift-2-bloat-in-the-twitter-app\/","title":{"rendered":"Swift 2 Bloat in the Twitter App"},"content":{"rendered":"<p><a href=\"https:\/\/twitter.com\/NolanOBrien\/status\/645055117486526464\">Nolan O&rsquo;Brien<\/a>:<\/p>\r\n<blockquote cite=\"https:\/\/twitter.com\/NolanOBrien\/status\/645055117486526464\">\r\n<p>Twitter app sizes:<br \/>\r\nw\/ Swift 1.2 = 65MB<br \/>\r\nw\/ Swift 2.0 = 125 MB<br \/>\r\nThinned w\/ Swift 2 = 77 MB<br \/>\r\n<br \/>\r\nEpiphany: App thinning counters Swift 2.0 bloat<\/p>\r\n<\/blockquote>\r\n<p>It&rsquo;s not clear to me why this is happening, but it sounds like both the Swift libraries and the compiled code for the app itself are larger than before.<\/p>\r\n<p>It seems entirely possible that overall system performance would decrease if more apps used Swift. The binaries are <a href=\"http:\/\/mjtsai.com\/blog\/2015\/06\/12\/swift-libraries-not-included-in-ios-9-or-el-capitan\/\">larger<\/a>, so they&rsquo;ll take up more storage space and RAM. They&rsquo;re calling back and forth to Objective-C a lot, so they won&rsquo;t see many benefits from pure Swift not doing <a href=\"http:\/\/mjtsai.com\/blog\/2014\/06\/27\/the-case-for-message-passing-in-swift\/\">message sending<\/a>, and they may incur extra overhead due to <a href=\"http:\/\/mjtsai.com\/blog\/2015\/09\/18\/objective-c-is-our-generations-cobol\/\">bridging<\/a>. <em>Writing<\/em> the code may be faster, though.<\/p>\r\n<p>Update (2015-09-24): <a href=\"https:\/\/developer.apple.com\/news\/?id=092415a&amp;1443125762\">Apple<\/a>:<\/p>\r\n<blockquote cite=\"https:\/\/developer.apple.com\/news\/?id=092415a&amp;1443125762\"><p>App slicing is currently unavailable for iOS 9 apps due to an issue affecting iCloud backups created from iOS 9 where some apps from the App Store would only restore to the same model of iOS device.<\/p>\r\n<p>When a customer downloads your iOS 9 app, they will get the Universal version of your app, rather than the variant specific for their device type.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Nolan O&rsquo;Brien: Twitter app sizes: w\/ Swift 1.2 = 65MB w\/ Swift 2.0 = 125 MB Thinned w\/ Swift 2 = 77 MB Epiphany: App thinning counters Swift 2.0 bloat It&rsquo;s not clear to me why this is happening, but it sounds like both the Swift libraries and the compiled code for the app itself [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","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":[2],"tags":[131,31,1137,26,30,71,901,49],"class_list":["post-12376","post","type-post","status-publish","format-standard","hentry","category-technology","tag-bug","tag-ios","tag-ios-9","tag-iosapp","tag-mac","tag-programming","tag-swift-programming-language","tag-twitter"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/12376","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=12376"}],"version-history":[{"count":5,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/12376\/revisions"}],"predecessor-version":[{"id":13520,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/12376\/revisions\/13520"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=12376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=12376"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=12376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}