Does V8 actually run compiler optimizations on WebAssembly? I thought it came pre-optimized and it just executed it.
My impression of WASM was it's ok but it's not very expressive for an assembly language - at least it has integers though. gcc.godbolt.org doesn't give you any library functions for it, even memcpy(), so I couldn't do a lot of testing.
I think it does. Here's an article introducing Liftoff [1] with the relevant parts:
> With Liftoff and TurboFan, V8 now has two compilation tiers for WebAssembly: Liftoff as the baseline compiler for fast startup and TurboFan as optimizing compiler for maximum performance.
> Immediately after Liftoff compilation of a module finished, the WebAssembly engine starts background threads to generate optimized code for the module.
[1]: https://www.assemblyscript.org/