{"id":15967,"date":"2016-10-06T14:37:25","date_gmt":"2016-10-06T18:37:25","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=15967"},"modified":"2016-10-06T14:39:38","modified_gmt":"2016-10-06T18:39:38","slug":"reducing-swift-compile-time","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2016\/10\/06\/reducing-swift-compile-time\/","title":{"rendered":"Reducing Swift Compile Time"},"content":{"rendered":"<p><a href=\"https:\/\/twitter.com\/ayanonagon\/status\/783378529115262976\">Ayaka Nonaka<\/a>:<\/p>\r\n<blockquote cite=\"https:\/\/twitter.com\/ayanonagon\/status\/783378529115262976\">\r\n<p>Spent the morning cutting our Swift compile time by ~3 min. Thanks @irace for the <a href=\"http:\/\/irace.me\/swift-profiling\">helpful blogpost<\/a>!<\/p>\r\n<\/blockquote>\r\n<blockquote cite=\"https:\/\/twitter.com\/ayanonagon\/status\/783379380223348736\"><p>Basically had to go back &amp; change most of our NSLayoutConstraint.activate to isActive = true. Uglier, but it really added up over time&#8230;<\/p><\/blockquote>\r\n<blockquote cite=\"https:\/\/twitter.com\/ayanonagon\/status\/783384797850710016\"><p>Unfortunate thing is that isActive = true is slower at runtime, so we&rsquo;re trading off compile time with run time :\/<\/p><\/blockquote>\r\n<p><a href=\"https:\/\/twitter.com\/nicklockwood\/status\/783937533277310976\">Nick Lockwood<\/a>:<\/p>\r\n<blockquote cite=\"https:\/\/twitter.com\/nicklockwood\/status\/783937533277310976\"><p>I just tried it. Turns out<\/p>\r\n<pre>{ $0 == \"e\" || $0== \"E\" }<\/pre>\r\n<p>takes 100ms more than<\/p>\r\n<pre>{ (c: Character) in c == \"e\" || c == \"E\" }<\/pre><\/blockquote>\r\n<p>Previously: <a href=\"http:\/\/mjtsai.com\/blog\/2016\/04\/29\/speeding-up-slow-swift-build-times\/\">Speeding Up Slow Swift Build Times<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Ayaka Nonaka: Spent the morning cutting our Swift compile time by ~3 min. Thanks @irace for the helpful blogpost! Basically had to go back &amp; change most of our NSLayoutConstraint.activate to isActive = true. Uglier, but it really added up over time&#8230; Unfortunate thing is that isActive = true is slower at runtime, so we&rsquo;re [&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":[69,255,31,71,901],"class_list":["post-15967","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-cocoa","tag-compiler","tag-ios","tag-programming","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/15967","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=15967"}],"version-history":[{"count":3,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/15967\/revisions"}],"predecessor-version":[{"id":15970,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/15967\/revisions\/15970"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=15967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=15967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=15967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}