Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't think WebAssembly is likely to be any faster than JavaScript is it? It's literally the same compiler in V8.


Oh but it is; see also asm.js, which is a subset of JS that removes a lot of the potential performance bottlenecks by removing those features from JS (mostly having to do with JS' dynamic nature, iirc).

Or in other words: javascript is an interpreted script language, webassembly is a compiled binary format.


> Or in other words: javascript is an interpreted script language, webassembly is a compiled binary format.

They're both just-in-time compiled. It doesn't matter if your program comes in as source code or a binary format if you're compiling it dynamically.

But I didn't know that WebAssembly ran under asm.js semantics. I guess that's the difference.


WebAssembly has its own semantics, similar to asm.js (statically typed) but much cleaner because it doesn't need to map onto JavaScript.


Unoptimized JS compared to unoptimized C compiled to wasm is likely to be slower, although if you only care about hitting 60fps, it doesn't matter if the unoptimized JS already hits that consistently.

If you care about GC pauses, wasm is much less likely to be affected.

Finally, if you compare asm.js to wasm, wasm will have a speedier load time, especially for large projects.

> It's literally the same compiler in V8.

AFAIK, V8 has bailouts for JS code, while wasm code cannot bail out. It uses the same compiler as when JS code gets JITted, but it is AOT.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: