Webkit uses a JIT compiler that applies three stages of optimization.
The first stage is a standard interpreter that makes sure that the JavaScrpt code runs without any delay. It may not run as fast as possible but it has low latency which is usually what users want. If code is called more than six times or if it loops more than 100 times then it moves on to the next stage and is JIT compiled without much optimization. If it is called more than 60 times or loops more than 1000 times then an optimizer is applied. The speed gained by the optimized code is about a factor of 3 faster than the JIT and 30 times faster than the interpreter.
The optimizer was good, but it didn't do the sort of job that a C or C++ optimizer does in optimizing register layouts and so on. Instead of implementing its own fourth stage, the WebKit team decided to use the existing LLVM code optimization layer.
The LLVM fourth stage is called FTL, which is clever because most people think "Faster Than Light" and not "Fourth Tier LLVM". The results are impressive - about 40 times faster than the interpreter and 3 times faster than the original optimized JIT.
You can read more about how the optimizer works, and how the time that the LLVM backend takes was reduced, in the original blog post - see More Information.
FTL is currently in WebKit nightly builds and soon you can expect to see it in release versions.
In many ways this is a case of WebKit catching up with Chrome and Firefox. Could it be that Chrome and Firefox could get similar improvements by using the state-of-the-art LLVM backend optimizer?
Microsoft has announced that Windows 10 is now running on 300 million active devices around the world. It has also announced that the free upgade offer will end on July 29th and that beyond that it wi [ ... ]
This really is the IoT for the rest of us. Cayenne is a drag-and-drop IoT builder that makes working with the Raspberry Pi to create IoT apps as easy as it possibly can be. This isn't just another IoT [ ... ]