WebAssembly modules for Babylon.JS

A littile of context: I am using Babylon.JS 7 with npm, and I’m actually love it, tho my project needs a lot of calculations and I came to WebAssembly, it makes code many times faster. And now while my code works fast, I have issues with speed of Babylon.JS itself.
I want to write some modules for Babylon in WebAssembly, and what’s the best way to do so? Should I make a fork for Babylon.JS for such tasks or there is simpler way to integrate some of my modules into engine itself?

Hey and welcome!!
This is a frequent question we got. The problem for us is that even though WASM would be faster, the cost of moving data from and to JS is prohibitive

What computation do you want to move to WASM?

I’ve made some researches about WASM and I know it may be a bottleneck sometimes, tho it looks like It may be possible to incapsulate some parts of engine to Wasm modules, it means you have to work with data and memory properly in order to make WASM modules fast enough. Right now it’s just a question, I’ll try to play with it, and test perfomance difference, but maybe Babylon already using some WASM inside of it, or using some external WASM modules

This is my view (so far ;))
Why WASM is not the future of Babylon.js | by Babylon.js | Medium

1 Like