Today's JavaScript code is optimized for performance, often using some conventional means, such as deferred execution, preprocessing, settimeout, and other asynchronous ways to avoid handling the main thread, and a little bit of webworker. Even for Webworker, the problem of blocking the main thread is only solved, but the problem of slow JavaScript computing performance is not resolved. Here are some scenarios that require intensive computing I recommend an artifact--webassembly to everyone. At this stage, the WebAssembly is suitable for a large number of dense computations and does not require frequent data communication with JavaScript and DOM. such as game rendering engine, physics engine, image audio and video processing editing, WebVR, encryption algorithm, etc.
Webassembly is a new type of code that runs in a modern web browser and provides new performance features and effects. It is designed not to write code but to provide an efficient compilation target for low-level source languages such as C, C + +, and rust. The webassembly module can be imported into a web app (or node. js) and exposes a webassembly function for use by JavaScript. The JavaScript framework not only uses webassembly to gain significant performance benefits and new features, but it also enables a wide range of features to remain user-friendly to network developers. This is an introduction from MDN. But you did not see the official introduction also do not know what webassembly is what is a thing, it doesn't matter at first I feel the same. In short, webassembly is the ability of a browser to directly run binary machine code. These machine codes are compiled in languages such as C, C + +, or rust.
What is webassembly?