3 ms·
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. B
by hyperhello 2y ago
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 2y agoYeah 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 2y agoIf 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.