News for hackers. Stuff that matters.
Re:Faster JavaScript Calls by Zababa on Monday February 15, 2021 @03:13PM (#26146748)
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/

Re:Faster JavaScript Calls by astrange on Monday February 15, 2021 @04:40PM (#26147820)
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.

Re:Faster JavaScript Calls by Zababa on Monday February 15, 2021 @05:55PM (#26148711)
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://v8.dev/blog/liftoff