{"id":20658,"date":"2018-02-22T15:22:11","date_gmt":"2018-02-22T20:22:11","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=20658"},"modified":"2018-02-23T08:26:35","modified_gmt":"2018-02-23T13:26:35","slug":"on-compiling-webkit-now-twice-as-fast","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2018\/02\/22\/on-compiling-webkit-now-twice-as-fast\/","title":{"rendered":"On Compiling WebKit (Now Twice As Fast!)"},"content":{"rendered":"<p><a href=\"https:\/\/blogs.gnome.org\/mcatanzaro\/2018\/02\/17\/on-compiling-webkit-now-twice-as-fast\/\">Michael Catanzaro<\/a>:<\/p>\n<blockquote cite=\"https:\/\/blogs.gnome.org\/mcatanzaro\/2018\/02\/17\/on-compiling-webkit-now-twice-as-fast\/\">\n<p>The approach is pretty simple: instead of telling the compiler to build the original C++ source code files that developers see, we instead tell the compiler to build unified source files that look like this:<\/p>\n<pre>\/\/ UnifiedSource1.cpp\n#include \"CSSValueKeywords.cpp\"\n#include \"ColorData.cpp\"\n#include \"HTMLElementFactory.cpp\"\n#include \"HTMLEntityTable.cpp\"\n#include \"JSANGLEInstancedArrays.cpp\"\n#include \"JSAbortController.cpp\"\n#include \"JSAbortSignal.cpp\"\n#include \"JSAbstractWorker.cpp\"<\/pre>\n<p>Since files are included only once per translation unit, we now have to parse the same headers only once for each unified source file, rather than for each individual original source file, and we get a dramatic build speedup. It&rsquo;s pretty terrible, yet extremely effective.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Michael Catanzaro: The approach is pretty simple: instead of telling the compiler to build the original C++ source code files that developers see, we instead tell the compiler to build unified source files that look like this: \/\/ UnifiedSource1.cpp #include \"CSSValueKeywords.cpp\" #include \"ColorData.cpp\" #include \"HTMLElementFactory.cpp\" #include \"HTMLEntityTable.cpp\" #include \"JSANGLEInstancedArrays.cpp\" #include \"JSAbortController.cpp\" #include \"JSAbortSignal.cpp\" #include \"JSAbstractWorker.cpp\" [&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":[326,255,31,30,138,71,328],"class_list":["post-20658","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-c-plus-plus","tag-compiler","tag-ios","tag-mac","tag-optimization","tag-programming","tag-webkit"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/20658","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=20658"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/20658\/revisions"}],"predecessor-version":[{"id":20659,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/20658\/revisions\/20659"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=20658"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=20658"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=20658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}