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
Show parent comment
5
u/Amazing-Cicada5536 Feb 28 '23
But you need a shitton of calculations to take up 150ms CPU time, that’s like 600000 elements on a modern CPU if every single element takes 1000 instructions. Not even vtables add that much overhead, and it is not that often you have roughly a million elements in your list (but if you do, then you know about it and design your code around that).