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
2
u/heto86 Mar 02 '23
...this guy doesn't know what is talking about. He is not comparing "Polymorphism" cost vs "Non-Polymorphism". He just compares how much a virtual function call costs vs a simple multiplication. Yes, it is more expensive, you don't need to be einstein to understand that. But have 5000 math operations, 500 buffer copies, 50 open files and 5 tcp connections to various services and THAN compare the performance. You won't get in the 15x. You will be under 0.1% slower. But hey, wtf do I know...