Since the bottle neck of the performance is JS according to #2366 , I think there will be a significant performance boost when using WebGL 2.0 and WebAssembly.
WebAssembly is just asm.js, so the same cross-boundary call costs apply. If you wrote everything, including things that use pixi, in C++ and compiled to asm.js it would be faster.
But if we wrote this lib in C++, compiled to asm.js, and gave it to you to use in your JS app it would be slower, significantly, due to the calls you would make into our lib. I've tried to make that work, but haven't successfully done it yet just because we have a large API surface. Maybe with a different architecture and completely different API we could get it to work, but then that would be a new lib and not Pixi anymore :smile:
That being said, WebGL 2.0 looks awesome and I'd love to use it, unfortunately browser penetration is super low right now and there aren't many "progressive improvement" additions we can make. Though I am sure there are some.
Thank you for your reply. And thank you for your Great works!
WebAssembly is just asm.js? Not at all. Two different technologies, and WebAssembly is much much faster than asm.js
@mchiasson It was in fact the exact same compiler and vm as asm.js at the time of writting that post (at least the public version was). Wasm has since forked from asm.js.
Originally, wasm was just asm.js but delivered as bytecode to skip the expensive decoding step. It still suffers from similar cross-boundary costs though they have done more work on it that asm.js and made that portion better.
the egret framework(https://www.egret.com/en/) use wasm in their 5.0 version, they solve the problem that "cross-boundary call costs" can be used for reference.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
WebAssembly is just asm.js, so the same cross-boundary call costs apply. If you wrote everything, including things that use pixi, in C++ and compiled to asm.js it would be faster.
But if we wrote this lib in C++, compiled to asm.js, and gave it to you to use in your JS app it would be slower, significantly, due to the calls you would make into our lib. I've tried to make that work, but haven't successfully done it yet just because we have a large API surface. Maybe with a different architecture and completely different API we could get it to work, but then that would be a new lib and not Pixi anymore :smile:
That being said, WebGL 2.0 looks awesome and I'd love to use it, unfortunately browser penetration is super low right now and there aren't many "progressive improvement" additions we can make. Though I am sure there are some.