in reply to Populating a hash
The number you assign to keys is rounded up to the next power of two.my %hash; keys(%hash)=1_000_000;
My understanding is (I would be interested to learn if this is correct) that when you have more buckets you have less collisions (i.e. entries that fall into the same bucket) and so retrieval of an entry is more efficient.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Populating a hash
by BrowserUk (Patriarch) on Mar 11, 2012 at 15:43 UTC | |
by morgon (Priest) on Mar 11, 2012 at 15:50 UTC | |
by BrowserUk (Patriarch) on Mar 11, 2012 at 16:58 UTC |