3 ms·
We do high performance computer vision in the browser (at 30/60 fps) that's an order of magnitude faster in WASM than JS. It simply would not be fast enough wit
by macguillicuddy 1y ago
We do high performance computer vision in the browser (at 30/60 fps) that's an order of magnitude faster in WASM than JS. It simply would not be fast enough without WASM.
- pjmlp 1y agoYou could offload to WebGL/WebGPU for that.
- coffeeindex 1y agoOr you could use Wasm
- pjmlp 1y agoWASM is slower, and the toolchain sucks for most languages.
- adwn 1y ago> WASM is slower […] Without more details on their exact use case, their algorithms, and their data movement patterns, you have no way of knowing this. Doing stuff on the GPU isn't automatically faster than doing it on the CPU.
- eviks 1y agoWhy does "most" matter in this case wnen you just need 1 that suits your needs?
- wtetzner 1y agoSure, but that's much more complex to implement, and comes with its own overhead.
- macguillicuddy 1y agoWe do for some elements of our pipeline. WebGPU will give us more opporunity for this in the future too but right now we need broader device support unfortunately.
- TekMol 1y agoInteresting. Really an order of magnitude? What types of operations are 10x faster in Wasm than in JS? Why can't the JIT compiler compile JS to the same native code as your Wasm gets compiled to?
- macguillicuddy 1y agoWe have tight inner loops over large numbers of pixels - in some cases optimized to the level of careful register choice and SIMD
- panstromek 1y agoBasically everything numerical. I have similar experience, translated some JS code to wasm - simple template matching algorithm, basically doing the same thing (looping over ArrayBuffer and computing some sums) and it was 10x faster.