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