Isn’t the best feeling in the world when your OS works faster than you want it to? You may not even know you want it to work faster, but this one fine day it just does and you want to jump wall to wall?
Google has revealed another little tweak that it has done to Chrome beta for better 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 direct result of this, Google’s Javascript applications get a boost and remain alive.
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.
This is all being handled by V8, Chrome’s Javascript engine. Instead of taking turns to compile every Javascript code and compiling it, V8 is now using simultaneous approach where there is a concurrent compilation of large pieces of code to avoid hanging of complex applications like games.
We should expect this improvement to fast and furiously zoom in in the next couple of months! 😀