3 ms·
This may be a bit of a reach, but there's AssemblyScript [1], which is a compiler from a strict variant of TypeScript to WebAssembly. Since technically V8 is al
by Zababa 6y ago
This may be a bit of a reach, but there's AssemblyScript [1], which is a compiler from a strict variant of TypeScript to WebAssembly. Since technically V8 is also a WebAssembly engine, porting some part of your codebase from JS/TS to AssemblyScript could improve your performance.
[1]: https://www.assemblyscript.org/ https://www.assemblyscript.org/
- astrange 6y agoDoes 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.
- Zababa 6y agoI 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://v8.dev/blog/liftoff https://v8.dev/blog/liftoff