What is Web Assembly?(Read 689 times)
What is Web Assembly? on: October 12, 2017, 03:02:23 pm
Web Assembly, also known as Web-asm for just WASM.

Although it is technically defined as a new, independent standard, from our perspective, WebAssembly is essentially a bytecode format for the asm.js JavaScript subset (asm.js is used to deploy Unity code to WebGL). Compared to the currently used text-based representation, the bytecode format is significantly reducing the size footprint of code compiled to asm.js. This leads to faster downloads of code, and, more importantly, to being able to parse and compile the code much faster and using much less memory. This will improve the startup times of large compiled JavaScript codebases, and reduce their memory requirements — both of which are currently some of the more common issues developers face when targeting the WebGL platform.

On browsers which don’t natively support the feature, the bytecode can very efficiently be translated to text-based asm.js code using JavaScript – which in most cases still results in faster content load times due to the download time improvements.

This means that the amount of data the browser needs to process gets reduced by 3.0x, and the compressed download size gets reduced by 1.4x. Actual results may change based on the project used, but we expect to see very relevant improvements to anyone caring about WebGL deployment in Unity.

For more information on WebAssembly, see the official FAQ.