6 ms·
In this particular case, even if performance is not concern I would use the hash map. It just reads better.
by never_inline 3y ago
In this particular case, even if performance is not concern I would use the hash map. It just reads better.
- cratermoon 3y agoInterestingly, some of the folks who harp about performance would see your "reads better" as a problem. I'm completely in agreement with the idea that, until the code is proven to be a performance problem, readability and clarity matters most. But the performance-first mavens would say the choice should be determined by Big-O performance and memory usage, then by readability.