Turbocharging V8 with mutable heap numbers · V8
5 comments
·February 25, 2025jacobp100
hyperhello
I was playing with Nan boxing recently. There are caveats like whether you can init a floating point Nan in immediate mode and how to do compares on the data. Basically it seems like you have to be ready to do most things with a two step process and cost yourself a cycle now and then.
jacobp100
Yeah but with JS you’re already miles away from that sort of instruction-level efficiency. For example, if it’s a object, you have to try and coerce it to a number
hyperhello
If it’s an object and you want it to be a number, you’re going to have to chug through that in any programming environment. JS interpreters are capable of inferring that variables will be numbers throughout code.
A lot of what people say against JavaScript they already said against Java, it’s recycled.
Alifatisk
Would be fun if we could redefine the word horsepower in this context
V8 seems to go through a lot of hoops just to avoid NaN boxing like JSC and Spider Monkey