Unfortunately there are performance issues with WebAssembly.compileStreaming
on iOS. On iOS devices, there is a limited amount of faster memory. Because of this, the engine doesn’t know which kind of memory to compile for until instantiate
is called.
If I understand correctly, for the JSC engine compileStreaming
will just do a memcopy of the .wasm. It’s only when instantiate
is called that the Memory object is created. Then the engine knows whether it will be using the fast memory, or just a normal malloc’d Memory that needs bounds checks. At this point, it can generate the code appropriately.
Because of this, we plan to recommend that all bundlers use instantiateStreaming
instead. Does this cause any issues for webpack?
This is fixed. We now use
instantiateStreaming
when possible. Falling back tocompileStreaming
+ asyncinstantiate
for WASM-to-WASM dependency chains.Falling back non-streaming variants when streaming is not supported by the browser.