DEV Community

Discussion on: Create Dev's offline page with Rust and WebAssembly ๐Ÿฆ„๐Ÿ’กโœจ

Collapse
 
philnash profile image
Phil Nash

It is really cool to learn WASM by recreating existing web experiences in a different language and compiling. This is a great tutorial for that!

Is this a good idea for WASM in general though? The web_sys crate looks useful, but are you just jumping back and forth across the JavaScript/WASM boundary in order to achieve this, negating any performance benefits of WASM itself?

Collapse
 
sendilkumarn profile image
Sendil Kumar

That is an awesome question.Boundary crossing is an important factor for any WASM app.

Performance wise it will be slightly slower every crossing here adds few nano seconds overhead. but browsers like Firefox is optimised well enough. You will have a problem only when you transfer huge chunk of data.

General advise will be use WASM where you need to have computation heavy operation and minimize boundary crossing