4 ms·
TL;DR: Instead of building Rust shared library for every OS/arch combination to use it from Go program, produce WASM chunk from Rust and load/execute it in Go u
by dottedmag 4y ago
TL;DR: Instead of building Rust shared library for every OS/arch combination to use it from Go program, produce WASM chunk from Rust and load/execute it in Go using wazero.
- iudqnolq 4y agoThe interesting bit for me was that executing the moderately nontrivial wasm fn took <1ms. That makes it more practical than I'd have expected.
- infogulch 4y agoI wonder what the performance penalty is compared to running directly on native machine code.
- manchmalscott 4y agoI think the wasm runtime they used compiled it to native on program boot, so I’d guess the penalty is really only on startup time?
- iudqnolq 4y agoI have no experise, but my gut feeling is that the sandboxing should still add some cost?
- nicoburns 4y agoI believe wasm is usually within 2x of native machine code, with the caveat that it can’t do simd or multi threading.
- pjmlp 4y agoIt can in latest versions of the standard, but it is still far from what JVM and CLR bytecodes offer in the box.