{"id":22362,"date":"2018-08-03T15:11:21","date_gmt":"2018-08-03T19:11:21","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=22362"},"modified":"2018-08-03T15:11:21","modified_gmt":"2018-08-03T19:11:21","slug":"why-the-new-v8-is-so-damn-fast","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2018\/08\/03\/why-the-new-v8-is-so-damn-fast\/","title":{"rendered":"Why the New V8 Is So Damn Fast"},"content":{"rendered":"<p><a href=\"https:\/\/nodesource.com\/blog\/why-the-new-v8-is-so-damn-fast\">Thorsten Lorenz<\/a> (via <a href=\"https:\/\/news.ycombinator.com\/item?id=17648139\">Hacker News<\/a>):<\/p>\n<blockquote cite=\"https:\/\/nodesource.com\/blog\/why-the-new-v8-is-so-damn-fast\"><p>In the past the V8 team focused on the performance of optimized code and somewhat neglected that of interpreted bytecode; this resulted in steep performance cliffs, which made runtime characteristics of an application very unpredictable overall. An application could be running perfectly fine until something in the code tripped up Crankshaft, causing it to deoptimize and resulting in a huge performance degradation - in some cases, sections would execute <strong>100x slower<\/strong>.  To avoid <i>falling off the cliff<\/i>, developers learned how to make the optimizing compiler happy by writing <i>Crankshaft Script<\/i>.<\/p>\n<p>However, it was shown that for most web pages the optimizing compiler isn't as important as is the interpreter, as code needs to run fast quickly. There is no time to <i>warm up<\/i> your code and since <i>speculative optimizations<\/i> aren't cheap, the optimizing compiler even hurt performance in some cases.<\/p>\n<p>The solution was to improve the <i>baseline performance<\/i> of interpreter bytecode. This is achieved by passing the bytecode through inline-optimization stages as it is generated, resulting in highly optimized and small interpreter code which can execute the instructions and interact with rest of V8 VM in a low overhead manner.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Thorsten Lorenz (via Hacker News): In the past the V8 team focused on the performance of optimized code and somewhat neglected that of interpreted bytecode; this resulted in steep performance cliffs, which made runtime characteristics of an application very unpredictable overall. An application could be running perfectly fine until something in the code tripped up [&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":"2018-08-03T19:11:23Z","apple_news_api_id":"8932170a-254c-475d-a493-01f97d2575ed","apple_news_api_modified_at":"2018-08-03T19:11:26Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/AiTIXCiVMR12kkwH5fSV17Q","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,288,346,1136,138,71],"class_list":["post-22362","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-compiler","tag-garbargecollection","tag-javascript","tag-node-js","tag-optimization","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/22362","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=22362"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/22362\/revisions"}],"predecessor-version":[{"id":22363,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/22362\/revisions\/22363"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=22362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=22362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=22362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}