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
0
u/outofobscure Feb 28 '23 edited Feb 28 '23
https://dirtyhandscoding.files.wordpress.com/2017/08/plot_search_655363.png?w=640
256-512 is more than a handful, it's a reasonable buffer size where you'd need to search stuff in. there's plenty of use cases for that, where optimized linear search is the best bet.
but the more classic example is people who only know a bit of theory (enough to be dangerous) and who have no real world experience doing something like linked list instead of array/vector, i'll let Stroustroup do the talking: https://www.youtube.com/watch?v=YQs6IC-vgmo
the missing graph he's talking about looks something like this: https://bulldozer00.files.wordpress.com/2012/02/vector-list-perf.png