3 ms·
> If your entire list of receipts fits into memory users won't notice a difference between a list and a set. If you had said "small enough", I would agree, but
by scott_s 10y ago
> If your entire list of receipts fits into memory users won't notice a difference between a list and a set.
If you had said "small enough", I would agree, but linear walks of data that can fit in memory can easily be noticed by users, for large enough lists. (Very large lists can fit in memory.)
But, at a higher level, yes, this is always true when people talk about performance: make sure what you're optimizing actually matters. I think a charitable reading of what
ThePawnBreak said should assume one has already determined this particular operation matters for performance.
- pjc50 10y agoEarlier this month I was looking at the question of "why does it take 160ms to scan a list of just 60,000 items? The answer turned out to be "because they're not adjacent and on this embedded system every single cache miss costs you hundreds of nanoseconds". I strongly agree that, like woodworkers, performance improvers should measure before they take out the power tools.