...

/

Analyzing the Memory Model in the WebAssembly Module

Analyzing the Memory Model in the WebAssembly Module

Learn how to use memory in the WebAssembly module.

We'll cover the following...

Inside the JavaScript engine, WebAssembly and JavaScript run at different locations. Crossing the boundaries between JavaScript and WebAssembly will always have a cost attached to it. The browser vendors implemented cool hacks and workarounds to reduce this cost, but when your applications cross this boundary, it will often become a major performance bottleneck for your application. It’s very important to design WebAssembly applications in a way that reduces boundary crossing. But once the application grows, it becomes difficult to manage such boundary crossing. To prevent boundary crossing, WebAssembly modules come with the memory module.

The memory section in the WebAssembly module is a vector of linear memories. A linear memory model is a memory-addressing technique in which the memory is organized in a single contiguous address space. It’s also known as the flat memory ...