Y
Hacker News
new
|
ask
|
show
|
jobs
by
adrianN
3334 days ago
But that's what profiling is for.
2 comments
arjie
3334 days ago
That argument favours hashmaps by default, though. After all, they're all right at small sizes and much better at big sizes.
link
usefulcat
3333 days ago
Profiling won't tell you what the chances are that the collection will someday need to contain more than N elements.
link
adrianN
3333 days ago
You don't replace every map in your code with a distributed Key-Value store, in case it might need to store terabytes in the future. Most of the time you have a pretty good idea whether a map has to store a hundred, or a hundred thousand elements.
link