JS vs Rust (WASM)

published on 2022/04/30

Rust is faster than JS in some cases, but those cases are rarer than we expected, and the performance gain is on the order of 2x some of the time, not 10x most of the time. The big 10x gains do appear when you really lean on Rust’s zero-cost abstractions — processing a million tiny Rust structs is faster than a million JS objects for reasons of memory layout and avoiding the GC — but this is a rare case, particularly for our incremental story. Without a 10x improvement we can't imagine engineers making the investment to add a whole new experimental tool chain to their stack that their team has to learn and maintain. We wouldn't do it ourselves, and we can't advise anyone else to do it. There are usually simpler ways to find performance improvements than Rust/Wasm.

Zaplib

This is a useful data point from people that are really thought that porting JS app to Rust/Wasm will speed up your apps