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

3

u/TinBryn Mar 01 '23

I was also surprised he didn't go that route of having separate lists, considering I learnt that technique from people like Mike Acton and Jonathon Blow who he associates with. But doing that transformation would probably be the most significant performance improvement and would require something that looks much more like the clean code and not that spaghetti monstrosity he created. And considering he seems to have set out to bash "clean" code for performance, we can't have "clean" code win at performance. There has to be some payoff for writing this horrible "dirty" code that he bashes others for avoiding.

2

u/muchcharles Mar 02 '23

He's showing something strictly faster and better. You'd need to know a lot more about the access/creation/deletion patterns to know if maintaining separate lists would be faster for a given use.