3 ms·
"Just like the old floating-point is slow; always use integer when possible." I know this was only an aside - but it took me the longest time to properly inter
by taylorius 2y ago
"Just like the old floating-point is slow; always use integer when possible."
I know this was only an aside - but it took me the longest time to properly internalize that floats were fast these days. I'm still getting used to the idea that double precision isn't a preposterous extravagance. :D
- Arech 2y agoIt depends on what you're doing. Doubles are still slower than floats due to twice bigger requirements imposed on memory performance & cache size. So if you doing a "calculator" style of work, there's not much difference, but if you're processing large arrays of data, it's still something you should think of.
- taylorius 2y agoYeah, exactly that. I was getting artifacts processing long vectors, and it was 32 bit float precision that was the culprit.
- spacechild1 2y agoOn certain platforms this rule still holds. Recently I have been working with the ESP32. Although some versions have an FPU, floating point math is still slower than integer math. Also, the FPU can only process 32-bit floats, 64-bit doubles are emulated in software and terribly slow.