Live data from Hacker News

An Abridged Cartoon Introduction To WebAssembly

smashingmagazine.com

1–10 of 107 posts

Re: An Abridged Cartoon Introduction To WebAssembly

#4
post #3

Since JS is already quite fast nowadays, how much faster will WASM typically be? (Yes, I know, it depends. I'm just looking for a rough estimate.)

To start Mozilla has stated it can be up to 10% faster, but compiler optimizations will improve on that over the next few years.

One big benefit will be being able to compile from an array of languages down to WebAssembly and maintain performance.

Re: An Abridged Cartoon Introduction To WebAssembly

#5
post #3

Since JS is already quite fast nowadays, how much faster will WASM typically be? (Yes, I know, it depends. I'm just looking for a rough estimate.)

One of the small things that may impact speed greatly, is that WASM has a real integer type, it isn't a float like JS has.

Some benchmarking has been talked about before [0], the upshot being C->WASM has a slowdown around 16-25ms. That's a hell of a lot faster than JS in a lot of places.

Unfortunately, as soon as you hook into the HTML APIs, like giving JS a result, you're back to JS speeds.

[0] https://news.ycombinator.com/item?id=13604537

Re: An Abridged Cartoon Introduction To WebAssembly

#8
post #3

Since JS is already quite fast nowadays, how much faster will WASM typically be? (Yes, I know, it depends. I'm just looking for a rough estimate.)

The generalish difference between JS and native code languages like C is about 10X. This varies from around 2X to 50X depending highly on what you're doing.

WASM should run at native speeds minus some special CPU instructions like vector stuff. So about as fast as highly optimized bytecode languages like Java, maybe 20% slower than optimized C.

Re: An Abridged Cartoon Introduction To WebAssembly

#10
post #6
post #3

Since JS is already quite fast nowadays, how much faster will WASM typically be? (Yes, I know, it depends. I'm just looking for a rough estimate.)

For cache aware code anywhere from 10-50x if trends hold from what you see in native code.

Maybe ram usage decrease and lower GC pressure ?
Post reply on HN