How can I understand the wasm_bindgen flow?

I use webrtc and my main goal is to avoid browser and DOM manipulation to alter my data reception flow.

So one question that I have that would help me understand how web_sys and wasm_bindgen works is will porting my webrtc API to rust free a bit of my processing and improve my data stream?

let's say I have a mouse move event on the browser side that get's updated every 10ms and that I have at the same time chunks of data getting received from a webrtc channel, I know that using both on the browser thread would slow down both of the events, but now If the webrtc channel event is used on the wasm side will it still be altered by the DOM manipulation?

I'm asking this because I know web_sys uses javascript API and would adding an extra layer (wasm) give even worst performances at the end?

I don't think WebAssembly runs in a different thread by default – at least the part of browsers that manipulates the DOM is usually single-threaded.

I guess you can use web workers for avoiding locking up the UI, but compiling to WASM won't in itself magically speed up your code.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.