WebAssembly is now well supported and could improve the speed of the core algorithm.
Initially this can continue to be single-threaded (with the webassembly function invoked inside the existing Web Worker) but later it could be further improved by using pthreads.
A compiled C++ or Rust method seems best (Rust may be more appropriate since the existing tooling targets individual methods, whereas the emscripten C++ tooling targets whole applications)
There is no need to maintain fallback javascript logic, as the only browser which does not support WebAssembly is IE, and this is already not a supported browser.
WebAssembly is now well supported and could improve the speed of the core algorithm.
Initially this can continue to be single-threaded (with the webassembly function invoked inside the existing Web Worker) but later it could be further improved by using pthreads.
A compiled C++ or Rust method seems best (Rust may be more appropriate since the existing tooling targets individual methods, whereas the emscripten C++ tooling targets whole applications)
There is no need to maintain fallback javascript logic, as the only browser which does not support WebAssembly is IE, and this is already not a supported browser.