{"id":13234,"date":"2016-01-08T17:33:06","date_gmt":"2016-01-08T22:33:06","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=13234"},"modified":"2016-01-20T18:36:18","modified_gmt":"2016-01-20T23:36:18","slug":"slow-swift-array-type-inference","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2016\/01\/08\/slow-swift-array-type-inference\/","title":{"rendered":"Slow Swift Array Type Inference"},"content":{"rendered":"<p><a href=\"https:\/\/twitter.com\/benjaminencz\/status\/685510563015741440\">Benjamin Encz<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/benjaminencz\/status\/685510563015741440\">\n<p>Slow compile time in Swift? Try to rearrange some of your expressions.<\/p>\n<\/blockquote>\n<p>Update (2016-01-20): <a href=\"http:\/\/irace.me\/swift-profiling\/\">Bryan Irace<\/a> (<a href=\"https:\/\/twitter.com\/irace\/status\/689185707898834945\">tweet<\/a>):<\/p>\n<blockquote cite=\"http:\/\/irace.me\/swift-profiling\/\"><p>I had a problem. The new iOS application that I&rsquo;m working on &#8211; written 100% in Swift &#8211; was noticeably taking <em>much<\/em> longer to compile than should, given its size (~200 files). More concerning, it was suddenly a <em>lot<\/em> slower than only a couple of weeks prior. I needed to get to the root of the problem as soon as possible, before it got any worse.<\/p>\n<p>The first step was to add <code>-Xfrontend -debug-time-function-bodies<\/code> to my Swift compiler flags [&#8230;] This causes the compiler to print out how long it takes to compile each function [&#8230;]<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Benjamin Encz: Slow compile time in Swift? Try to rearrange some of your expressions. Update (2016-01-20): Bryan Irace (tweet): I had a problem. The new iOS application that I&rsquo;m working on &#8211; written 100% in Swift &#8211; was noticeably taking much longer to compile than should, given its size (~200 files). More concerning, it was [&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":[4],"tags":[255,71,901],"class_list":["post-13234","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-compiler","tag-programming","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/13234","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=13234"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/13234\/revisions"}],"predecessor-version":[{"id":13321,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/13234\/revisions\/13321"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=13234"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=13234"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=13234"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}