-
-
Notifications
You must be signed in to change notification settings - Fork 458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] WASM implementation..? #552
Comments
I've only had experience compiling C++ libraries into WASM so you can access libraries that don't currently have JavaScript implementations. Would be curious to learn more about how you think WASM could be helpful. |
As far as I know things that doesn't interact with the DOM elements can be implemented in WASM, idk, maybe the calculations done for SVG elements, Idk what methods or calculations on Two.JS doesn't interact directly with the DOM... |
Given this article I think there's reason to believe WASM would give ~30% performance improvements. The management of the scenegraph and all the calculations associated with it would be able to be put on the WASM, but would still need to eventually draw everything back to an SVG or Canvas. My guess is that the biggest performance improvements would come from memory management, because the JS garbage collector is hard to manage (and I'm likely doing a terrible job at managing). Definitely something worth tracking! Thanks. |
Actually memory management I believe is one of the biggest issues in JS, specially when dealing with projects with lots of calculations and many many variables... I've test some things (with different libraries) and in the beginning the page goes fine but over time it lags a lot... I believe is worth trying to implement WASM... |
AssemblyScript suggests that it would be possible to simply pass the already defined functions in JavaScript and compile them as WASM binaries: https://www.assemblyscript.org/compiler.html#host-bindings In this possible use case the SVG interpret functions could be applied this way, though some modifications would be made to make compatible export objects / functions. |
Hi!
Many of my projects require fast calculations or a lot of calculations on a loop, so I was wondering:
Have you considered on implementing the use of WASM for performance?
I'm kind of new on WebAssembly and I still don't know how much can be processed from js on assembly, so I'm just wondering if it's possible and would it give Two.JS projects a better performance? What methods or calculations on Two.JS could be implemented on WASM?
The text was updated successfully, but these errors were encountered: