Re:Moving from TypeScript to Rust / WebAssembly
by brabel on Thursday July 09, 2020 @04:21AM
(#23778068)
You can't judge the performance of WASM solely based on experiments you made using AssemblyScript (a TypeScript subset that compiles directly to WASM). As WASM is meant to be a low level compiler target, a proper comparison would be with binaries produced by the Rust or C compilers that don't rely on a specific GC implementation.
[ Parent
| on HN ]
Re:Moving from TypeScript to Rust / WebAssembly
by v_pragma on Thursday July 09, 2020 @04:32AM
(#23778133)
GC aside, I've inspected assembly code (.wast files) for top 10 hottest methods in my code, and it was pretty much perfect, Rust and C will probably end up with something similar. However, there was no performance improvements whatsoever, those methods performed similarly to their JS equivalents.
UPD: modern JS engines are extremely capable of optimizing stuff and they can probably come up with machine code similar to what Rust or C will produce given that you keep your code predictable and optimization-friendly.