News for hackers. Stuff that matters.
Re:Is WebAssembly faster than JavaScript? by vanderZwan on Thursday October 25, 2018 @07:20AM (#18300034)
Wow, nice demos! You got yourself a new Github follower.

Out of curiosity, because you seem to focus on 3D graphics or really old-school emulation: have you given any thought in how WASM might be beneficial for rendering 2D graphics? What would you expect to be the best approach to squeeze more performance out of that use-case?

Re:Is WebAssembly faster than JavaScript? by flohofwoe on Thursday October 25, 2018 @03:03PM (#18303599)
I think 2D graphics is also mainly a WebGL problem. Fill a vertex buffer with 2D vertices each frame, and try to render it with as few draw calls as possible (e.g. fill vertices sorted by texture, and only issue a new draw call when the texture changes, pack small textures into a bigger texture atlas etc...). Most what makes this fast is how WebGL is used and can be done quite efficiently from JS too. WASM may help in the tight loop where the vertex buffer is filled with data though.