Live data from Hacker News

Comparing Rust and JavaScript

chaotic.netlify.app

1–10 of 97 posts

Re: Comparing Rust and JavaScript

#6
post #2

Can someone explain what exactly I am looking at here? The about page seems to be an empty page for me.

Compares the rendering speed of Javascript/ES-6 to WASM compiled from Rust. Result: JS/ES-6: ~4000 pixels per millisecond. WASM/Rust: ~16000 pixels per millisecond. These results are on Firefox using M1 Max

Re: Comparing Rust and JavaScript

#7
I 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.

Re: Comparing Rust and JavaScript

#8
It's nice to see how much faster is wasm. This kind of problem would also be nice for parallelization. What's the state of multi-threading wasm? any advantage over javascript web workers?

Re: Comparing Rust and JavaScript

#9

More of a comparison between WebAssembly and JavaScript, really. That the WebAssembly was compiled from Rust is not especially meaningful here.

Not sure, it could also be viewed as a comparison of ahead-of-time compilation vs. just-in-time compilation (I guess the code paths are hot enough to be completely "jit-ed" here), and then the compiler isnt irrelevant at all.

But havent looked into the details on how much difference that alone makes in this case.

I think its also a testament on how fast JS has gotten.

Re: Comparing Rust and JavaScript

#10
post #7

I 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
Post reply on HN