{"id":14236,"date":"2016-04-21T10:24:10","date_gmt":"2016-04-21T14:24:10","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=14236"},"modified":"2016-04-21T10:24:10","modified_gmt":"2016-04-21T14:24:10","slug":"swift-type-checking-performance-case-study","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2016\/04\/21\/swift-type-checking-performance-case-study\/","title":{"rendered":"Swift Type-checking Performance Case Study"},"content":{"rendered":"<p><a href=\"http:\/\/article.gmane.org\/gmane.comp.lang.swift.devel\/1648\">John McCall<\/a> (via <a href=\"https:\/\/twitter.com\/olebegemann\/status\/720171521508028416\">Ole Begemann<\/a>):<\/p>\n<blockquote cite=\"http:\/\/article.gmane.org\/gmane.comp.lang.swift.devel\/1648\"><p>The standard library team asked the compiler team to take a look at the performance of the type-checker. \nTheir observation was that several in-progress additions to the standard library were causing a\ndisproportionate increase in the time it required to compile a simple-seeming expression, and they were\nconcerned that this was going to block library progress.  This is the resulting analysis.<\/p>\n<p>[&#8230;]<\/p>\n<p>In general, it is expected that changes to the source code can cause non-linear increases in type-checking\ntime.  For one, all type systems with some form of generic type propagation have the ability to create\nexponentially-large types that will generally require exponential work to manipulate.  But Swift also\nintroduces several forms of disjunctive constraint, most notably overload resolution, and solving\nthese can require combinatorial explosions in type-checker work.<\/p>\n<p>[&#8230;]<\/p>\n<p>Note that there have been proposals about restricting various kinds of implicit conversions.  Those\nproposals are not pertinent here; the implicit conversion are not a significant contributor to this\nparticular problem.  The real problem is overloading.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>John McCall (via Ole Begemann): The standard library team asked the compiler team to take a look at the performance of the type-checker. Their observation was that several in-progress additions to the standard library were causing a disproportionate increase in the time it required to compile a simple-seeming expression, and they were concerned that this [&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,46,138,71,901],"class_list":["post-14236","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-compiler","tag-languagedesign","tag-optimization","tag-programming","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/14236","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=14236"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/14236\/revisions"}],"predecessor-version":[{"id":14237,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/14236\/revisions\/14237"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=14236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=14236"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=14236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}