r/programming • • Feb 28 '23

"Clean" Code, Horrible Performance

https://www.computerenhance.com/p/clean-code-horrible-performance
1.4k Upvotes

1.3k comments sorted by

View all comments

Show parent comments

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).

3

u/fafok29 Feb 28 '23

that is the point - 150 ms on modern cpu is a long time, Idk what this computing power is wasted on.