top | item 45664665 (no title) InkCanon | 4 months ago Could you explain more on what bindgen was lacking and what you did different? discuss order hn newest tristanhoy|4 months 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-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.
tristanhoy|4 months 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-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.
tristanhoy|4 months ago
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-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.