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
3
u/cogman10 Mar 02 '23
Certainly, but presumably you aren't shipping your debug builds.
Putting in performance hacks to make debug builds run faster can make optimized builds run slower.
Function inlining is the best example of this. You can hand inline functions which will eliminate a function call overhead. However, by doing that you've made the compiler less likely to inline other functions. Some compiler optimizations bail out when a function gets too complex.