Move execution of WASM code into a worker
Opened this issue · 1 comments
On big inputs, the WASM functions sometime take a non negligible time, causing responsiveness problems.
An alternative would their execution into a worker.
According to the wasm-bindgen docs:
At the time of this writing, only Chrome supports modules in web workers, e.g. Firefox does not
But as we have seen ourselves we are now able to use import
directly in the <script>
of an HTML file (that's how we import sophia wasm and the monaco editor)
And according to this website: https://caniuse.com/mdn-api_worker_worker_ecmascript_modules all modern browsers supports ES modules inside workers now. Firefox started supporting it since june 2023, which explains why the wasm-bindgen docs is not up to date. But that means it should be much easier to setup than what is currently documented!