Analyzing the memory model in the WebAssembly module
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, this boundary crossing will often soon become a major performance bottleneck for your application. It is very important to design WebAssembly applications in a way that reduces boundary crossing. But once the application grows, it becomes difficult to manage this 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 contagious address space. It is also known as the Flat memory model.
The linear memory...