Hacker News new | ask | show | jobs
by hirako2000 861 days ago
I don't have any benchmark for these.

Some did some comparisons.

"Versus our initial moment-based implementation, in Chrome we see a 78% improvement (183.93ms to 39.69ms), in Firefox a 90% improvement (269.80ms to 24.88ms), and in Safari an 83% improvement (166.56ms to 27.98ms)."

Ref: https://engineering.widen.com/blog/A-Tale-of-Performance-Jav...

More related to rendering things:

https://www.reddit.com/r/rust/s/wOzuEzFdM5

Dom elements are expensive, so probably not down to v8 itself in that second comparison.

Generally one should expect significantly higher performance with Rust compiled into (optimised) Wasm. 2x, 10x. I don't have strong numbers in hands to share now.

But in some minority of cases, it might be slower than on v8 the latter has a few extremely highly optimised JS operations.

1 comments

Eh, would rather see a comparison to a webGL approach given we’re doing tweening here. Fine to not have one, just sorta leaves the question up in the air. Faster than Canvas at the very least!
Why would we compare to webGL?

Shaders would only (tremendously) improve rendering vs dom elements.

And a Wasm can also leverage the GPU so it would yield similar performance comparing apple to apple.

V8 interpreting JS for CPU computation I think is what OP was asking for, as it is relevant to determine the best optimised route to get the highest performance on compute.

If most published benchmark are correct*, then a GPU for graphics applications complied into Wasm coming along CPU compute logic would perform better than its JS+WebGL counter part.

Would be nice to benchmark that to confirm.

*and they probably are as Wasm executes at near native speed. V8 executes certain operations at near native speed. The rest takes the overhead hit of the interpreter.

Why compare to WebGL? Tweening is for games, and making games in the DOM or in a Canvas is silly.
I'm sorry I just may not understand. My point is that even graphic intensive games also are compute (CPU) intensive, so significant performance differences is where it matters. Webgl, WebGPU, wasm all execute shaders on the GPU I don't see the overhead to be critical and of much interest to benchmark. I could be wrong and some drastically different results could be observed but what I've read on the subject indicates it won't. Or I don't understand what you mean.