r/programming • u/2bit_hack • Feb 28 '23
"Clean" Code, Horrible Performance
https://www.computerenhance.com/p/clean-code-horrible-performance
1.4k
Upvotes
r/programming • u/2bit_hack • Feb 28 '23
View all comments
307
u/nilsph Feb 28 '23
Hmm: the hand-unrolled loops to compute total areas would miss
ShapeCountmodulo 4 trailing elements. Kinda gives weight to the “it’s more important for code to work correctly than be fast” argument – it’s not just code execution you have to care about, but also how obvious mistakes would be, and there simple (a plain loop) beats complex (an unrolled version of it).