You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From my understanding, WebAssembly does not provide built in functions for trigonometry.
And as a consequence, the performance of such functions when porting from C++ (with Emscripten using musl implementation) are very bad. JavaScript is very much better.
That would be extremely nice if such functions can be builtin in WebAssembly. One of application domain of WebAssembly is running 3D/Graphics apps in near native C++ performance which is using a lot of trigonometry.
nothing prevents the compiler from emitting fast implementations with different precision, depending on the context?
as a more general approach thanks to the component model, wasm interpreters and bytecode compilers could completely replace functions with internal opcodes, if the name and signature are matched
Thanks for your answer. I looked to musl trig functions and they are very similar to the ones in V8 engine for example.
I don't really get why this performance impact (but I am newbie in wasm and compiler domain, maybe I miss something).
Of course I could implement faster methods and less accurate to compensate but that was not my intend.
as a more general approach thanks to the component model, wasm interpreters and bytecode compilers could completely replace functions with internal opcodes, if the name and signature are matched
Can you give a link to a doc that might help me in understanding this approach ? Thanks.
From my understanding, WebAssembly does not provide built in functions for trigonometry.
And as a consequence, the performance of such functions when porting from C++ (with Emscripten using musl implementation) are very bad. JavaScript is very much better.
That would be extremely nice if such functions can be builtin in WebAssembly. One of application domain of WebAssembly is running 3D/Graphics apps in near native C++ performance which is using a lot of trigonometry.
Please see emscripten-core/emscripten#19284 for more details and measures.
The text was updated successfully, but these errors were encountered: