> 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.
Comparing Rust and JavaScript
11–20 of 97 posts
Re: Comparing Rust and JavaScript
#12I get that the intended meaning is "JS sux", but I can't help being impressed with how performant engines are. The "pixels per ms" count ratio is less than 3:1 on my machine, in what I imagine is a CPU-heavy task.
On my phone it's closer to 6:1. 500 jumps to 3000 with WASM
Re: Comparing Rust and JavaScript
#13Re: Comparing Rust and JavaScript
#14Re: Comparing Rust and JavaScript
#15On my Linux laptop, Firefox: 1.7K vs 3K
On my Linux laptop, Brave: 1.5K vs 6K
It does seem to vary quite a bit based on the pattern being drawn, though. These ratios seem to roughly hold, but there's wide variance.
Re: Comparing Rust and JavaScript
#16Re: Comparing Rust and JavaScript
#17More of a comparison between WebAssembly and JavaScript, really. That the WebAssembly was compiled from Rust is not especially meaningful here.
Re: Comparing Rust and JavaScript
#18I'm curious why a lot of people get a 3x improvement. I get about 6.5-7x speed up, which suspiciously lines up with a 60hz vs 144hz framerate...
On my 4k screen (which I run at 100% scaling) on Firefox on Linux I get around 2700 on ES and 7500 on WASM.
But if I reduce the window size to half the screen, I get 3000 for ES and 10000 for WASM.
Re: Comparing Rust and JavaScript
#19More of a comparison between WebAssembly and JavaScript, really. That the WebAssembly was compiled from Rust is not especially meaningful here.
And I'm not sure if we can assume that all languages that offer compilation to WASM would be roughly "rust fast": I wouldn't be surprised if we already had some examples that aren't really good matches for that tight inner loop case you might want to wasmify. Perhaps there are already some that just want to get the "runs in browser" checkbox ticked?
Re: Comparing Rust and JavaScript
#20More of a comparison between WebAssembly and JavaScript, really. That the WebAssembly was compiled from Rust is not especially meaningful here.