3 ms·
> Even if true, it doesn't help much if you have to marshall through JS for nearly every call. If you're doing a lot of cheap calls, it's probably not the opti
by swalsh 6y ago
> Even if true, it doesn't help much if you have to marshall through JS for nearly every call.
If you're doing a lot of cheap calls, it's probably not the optimal way to get a performance boost. I think Web Assembly shines at taking an expensive function, and doing it faster. For example, let's say I wanted to multiple a few large matricies of values. In Javascript this would be VERY slow. In Web Assembly it would be a bit faster, but then Web Assembly plus Web GPU allows me to do it REALLY fast. Yes, I'd then have to marshal the end result back to javascript but that's still cheaper then trying to do all that math natively in Javascript.