The crippling problem with WASM is that all data must be serialized prior to calling a JS library. You can't just call the API directly. It causes massive overhead and performance problems, making a data-intense "pure" WASM application very slow.
Edit: The problem is very evident if you need to graph 1000s of points. Calling fetch (js-space API) has to translate data to something your WASM language can handle, then after parsing it in WASM there's overhead either for serializing the data into something the JS graphing library can handle, or overhead for passing raw HTML through js-space.
It's true that there are plenty of APIs that require JS objects, but for anything that takes an ArrayBuffer, you can get export a Wasm memory that has a .buffer property and then slice it however you like; no copying and no serialization.
That's highly misleading.
The crippling problem with WASM is that all data must be serialized prior to calling a JS library. You can't just call the API directly. It causes massive overhead and performance problems, making a data-intense "pure" WASM application very slow.
Edit: The problem is very evident if you need to graph 1000s of points. Calling fetch (js-space API) has to translate data to something your WASM language can handle, then after parsing it in WASM there's overhead either for serializing the data into something the JS graphing library can handle, or overhead for passing raw HTML through js-space.
Replies (1)