Google speeds up Chrome by compiling JavaScript in the background
Google today revealed a tweak it has made in the latest Chrome beta to further boost performance: concurrent compilation, which offloads a large part of the optimizing compilation phase to a background thread. Previously, Chrome compiled JavaScript on the main thread, where it could interfere with the performance of the JavaScript application.
As a result, Google says JavaScript applications remain responsive and performance gets a boost. This is all handled by V8, Chrome’s JavaScript engine.
Here’s how it works. First, V8 defers compilation of JavaScript functions until immediately before they are executed the first time (to reduce the overall time spent compiling). Next, pieces of code that are executed very often are compiled a second time by a specialized optimizing compiler. This second pass makes takes more time, but thanks to many advanced optimization techniques, it delivers much faster code.
Here is Chrome without concurrent compilation (V8 is fully occupied optimizing a large piece of code, causing an execution pause):
Here is Chrome with concurrent compilation (V8 still optimizes the large piece of code, but does so in a background thread):
The graphs above show excerpts of V8′s vital signs when running Mandreel, part of Google’s Octane benchmark suite, on a Nexus 5. The black bar represents JavaScript execution, so the goal is to get it as close to solid as possible.
Instead of taking turns compiling optimized Javascript code and executing it, V8 now uses concurrent compilation for large pieces of code to avoid stuttering and dropped frames in complex applications like games. We can expect these improvements to arrive in the stable version of Chrome in the next few months.
From: http://thenextweb.com/google/2014/02/13/google-speeds-chrome-compiling-javascript-background/#!vH4jn
...You must Sign up as a member of Effecthub to view the content.
A PHP Error was encountered
Severity: Notice
Message: Undefined index: HTTP_ACCEPT_LANGUAGE
Filename: helpers/time_helper.php
Line Number: 22
1904 views 0 comments
You must Sign up as a member of Effecthub to join the conversation.