4 ms·
wasm-bindgen generates a lot of marshalling code on both sides with dynamic allocations and this kills performance. For low-level algorithms, this means that J
by tristanhoy 1y ago
wasm-bindgen generates a lot of marshalling code on both sides with dynamic allocations and this kills performance.
For low-level algorithms, this means that JS + wasm-bindgen will only be marginally faster than pure JS - the overhead of crossing the boundary is that much of an issue: https://dev.to/bence_rcz_fe471c168707c1/rust-webassembly-performance-javascript-vs-wasm-bindgen-vs-raw-wasm-with-simd-4pco?utm_source=chatgpt.com https://dev.to/bence_rcz_fe471c168707c1/rust-webassembly-per...
With zaw, it uses a pre-allocated, fixed-width buffer for communication, same technique as Bence uses in that article.
It's a night and day difference.