Are you ready for high-performance? It’s time to Liftoff.
Since its release, WebAssembly has been making waves. Wasm is a “binary instruction format for a stack-based virtual machine…designed as a portable target for compilation of high-level languages like C/C++/Rust, enabling deployment on the web for client and server applications”.
From it’s GitHub about page: “V8 implements ECMAScript as specified in ECMA-262, 5th edition, and runs on Windows (XP or newer), Mac OS X (10.5 or newer), and Linux systems that use IA-32, x64, or ARM processors.
Take a look at Liftoff
How does Liftoff improve an already sleek engine? The new compilation pipeline reduces startup time for apps written in WebAssembly.
Speed is the name of the game. There are only two stages to Liftoff: Function body decoder and code generation.
The release blog explains these two steps:
“…the function body decoder does a single pass over the raw WebAssembly bytes and interacts with the subsequent stage via callbacks, so code generation is performed while decoding and validating the function body. Together with WebAssembly’s streaming APIs, this allows V8 to compile WebAssembly code to machine code while downloading over the network.”
Liftoff’s single pass over the opcodes of a function is what allows to maintain such high speed. For more information on how a function is handled, check out the sample on the release blog.
With Liftoff, you can see a performance increase of up to 10x (or more).
It isn’t just for high-end machines either. V8 tested Liftoff’s speed on both a MacBook and a Z840. It ran up against V8’s old engine: TurboFan. The results were crystal clear. In both cases, Liftoff compiled code faster by a wide margin.
What does the future hold?
The release blog lists some future plans for Liftoff that developers can look forward to seeing.
- Improved startup times and reduced memory usage
- Porting Liftoff to mobile devices
- Improved code generation performance
- Dynamic tier-up for mobile devices
As of right now, Liftoff is only usable on desktop. However, once it is ported to mobile devices, it will reach a broader audience of developers.
Interesting in contributing to V8’s success? Learn more on GitHub and be sure to join the mailing list so you don’t miss out on new features and future improvements.