Port to asm.js/webassembly, is it worth?

I replayed to an pessimistic statement on Github. But this form may be a better place to discus about #wasm #webassembly

1 Like

In a prior life, I did a lot with OpenCL. Though I was primarily concerned with throughput, not some arbitrary response time, a.k.a 60 fps, Amdahl’s law really dictates performance.

Simply stated, the more time spent in single threading dramatically nullifies the effect of having more shaders / gpu cores. This may seem to support asm.js, but I think the hassle is not going to be worth it. Beating JS by minor amounts in some areas is not going to change anything.

On the other hand, swapping out a browser for either BabylonNative or exokit, I have observed a pretty large speed up to draw & all other OpenGL calls. This is an area of single threading overhead that is very large in a browser that a framework cannot do much about.

These two are really for targeting devices like Hololens / Magic Leap, etc. Dramatically reducing draw calls on devices that draw everything twice for a 3D effect really changes the game. You can develop & test on a desktop, with everything in JS on either a browser or a desktop implementation of one of them, then have a pretty easy deployment.

You have to go where things suck to get big improvements.