With the launch of linker target.
Source: Unity Blog
WebAssembly replaced asm.js because it is faster, smaller and more memory-efficient, which are all pain points of the Unity WebGL export.
A WebAssembly file is a binary file (which is a more compact way to deliver code), as opposed to asm.js, which is text. In addition, code modules that have already been compiled can be stored into an IndexedDB cache, resulting in a really fast startup when reloading the same content. In WebAssembly, the code size for an empty project is ~12% smaller or ~18% if 3D physics is included.
Source: Unity Blog
WebAssembly also has its own instruction set. In Development builds, it adds more precise error-detection in arithmetic operations. In non-development builds, this kind of detection of arithmetic errors is masked, so the user experience is not affected.
Asm.js added a restriction on the size of the Unity Heap; its size had to be specified at build-time and could never change. WebAssembly enables the Unity Heap size to grow at runtime, which lets Unity content memory-usage exceed the initial heap size.
Unity is now working on multi-threading support, which will initially be released as an experimental feature and will be limited to internal native threads (no C# threads yet).
Debugging hasn’t got any better. While browsers have begun to provide WebAssembly debugging in their devtools suites, these debuggers do not yet scale well to Unity3D sizes of content.
What’s next to come
Unity is still working on new features and optimizations to improve startup times and performance:
- Asynchronous instantiation
Unlock access to the largest independent learning library in Tech for FREE!
Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
Renews at $19.99/month. Cancel anytime
- Structured cloning, which allows compiled WebAssembly to be cached in the browser
- Baseline and tiered compilation, to speed-up instantiation
- Streaming instantiation to compile Assembly code while downloading it
- Multi-Threading
You can read the full details on the Unity Blog.
Unity 2018.2: Unity release for this year second time in a row!
GitHub for Unity 1.0 is here with Git LFS and file locking support
What you should know about Unity 2018 Interface