While we"ve seen close attention paid to JavaScript performance in web browsers, including Microsoft Edge which made a clean break from 20 years of legacy Internet Explorer code, attention is now turning towards further improving code execution efficiency inside the browser.
WebAssembly, a collaborative effort of the WebAssembly Community Group which includes Microsoft, Mozilla, Google, and Apple, represents that next step. Unlike JavaScript, which requires "Just In Time" (JIT) compilation of plaintext code prior to execution, web browsers would instead download precompiled WebAssembly bytecode. Another interesting prospect enabled by WebAssembly will be the ability to port external code, written in C or C++, to the web.
When browsers eventually enable the functionality to process WebAssembly binary code, it will enable executable packages that could compress to smaller sizes compared to plain-text JavaScript widely used today. In turn, content can be delivered faster, making more efficient use of bandwidth, an important consideration for mobile devices. Furthermore, dramatic improvements in overall performance on mobile devices were observed, with WebAssembly code loading more than 20 times faster, which would help in part to alleviate battery drain.
At present, the major browsers are at varying stages of their browser preview implementations. While Microsoft is still hard at work incorporating WebAssembly support into ChakraCore, the company says it is close to shipping a preview in Microsoft Edge. Meanwhile, Mozilla and Google require WebAssembly support to be enabled by changing configuration flags in their respective Firefox Nightly and Chrome browsers.
Source: Windows Blog | WebAssembly image via Kripken (GitHub)