Replies: 3 comments
-
Do you mean the "fastest" as in development time or runtime performance? If you mean runtime, you will basically always have to use the As for
|
Beta Was this translation helpful? Give feedback.
-
roughly what's the cost of FFI from js / wasm? in request per second kind of performance overhead. what's worth the time to write in rust->wasm just for js calling? |
Beta Was this translation helpful? Give feedback.
-
@gitmko0 Each crate has a different purpose, but they are all designed to work together:
All of the crates use wasm-bindgen, because wasm-bindgen contains the core functionality which is needed for using JS code. It's normal in Rust to have small crates which do one thing, which is why the functionality is split into different crates.
You need to be more specific, since the cost will vary depending on the types and operations that you're doing. But you can always just benchmark it yourself to see what the performance is for your code.
That will depend on your program, so you have to benchmark it to see. But in general Rust is very fast, and the communication between JS and Rust is also usually very fast, which is why Rust DOM frameworks can be faster than React/Angular/etc. |
Beta Was this translation helpful? Give feedback.
-
Four crates here, which is the fastest? Basically I would like to just use wasm and the js part is just for interfacing with wasm processes. in this sense, which is the fastest one to work with?
I saw a lot of raw wasm_bindgen things but not sure what it means.
js_sys
wasm_bindgen
wasm_bindgen_futures
web_sys
Why 4 and not just 2? e.g. wasm_bindgen_futures and web_sys seems to be good enough?
Beta Was this translation helpful? Give feedback.
All reactions