Efficient float32 arithmetic in JavaScript
blog.mozilla.org
blog.mozilla.org
I guess that's true on mobile platforms? My understanding is that on modern desktop CPUs, the only time double precision takes more CPU cycles is if you're doing SSE (since you can't fit as many doubles into an SSE register).
And I suppose in some contexts where you have to compute a value iteratively, you'd have to do more iterations to get full precision out of a double. But the situations where you really care about having an actual float32 instead of simply letting the trailing bits of the float64 be incorrect are relatively rare.
Also, it's important to keep in mind that even if the cycle count is the same, you're using twice as much memory which means you're occupying twice as much space in cache. If your buffers suddenly get twice as large to represent the same data, that's going to negatively impact performance, just like how 64-bit pointers result in a perf penalty vs 32-bit pointers. If everything stays in registers you're probably fine, since those are all fixed-size and usually have more than enough space for a few 64-bit floats.