Benchmark between javascript, wasm, rust, and rust-bindings

5 comments · 83% upvoted · source · other discussions

comments

ConsoleTVs

What was your intention?

The price you pay for interpreted languages (+ garbage collection) is significant, were you expecting similar results?

Pascalius [OP]

Intention for the benchmark? If you have performance critical code in node or the browser, it is good to have some insight of possible optimizations. Mostly I was expecting results in this ballpark, but wasm is unexpected fast when the engine runs hot.

wasm is already compiled to binary, so I did't expect any JIT optimizations, but it looks like it.

[deleted]

[removed]

Pascalius [OP]

When porting, the javascript code generally looked fine. If you have concrete changes which you think matter, I can rerun the benchmarks with them.

ConsoleTVs

I mean, what is the reason for the benchmark? Are you trying to prove a point? The results are as expected.

Pascalius [OP]

As I said, to gain insight. Since it's as expected, you have an explanation for the relative wasm performance improvement?