Load of map class

The size of hash table that Map class has and the number of contents that map class are related as shown in below.

  • The searching speed significantly drops when there are too many contents comparing to the size of hash table. This is simply because the number of comparison calculations increases as the number of contents in bucket increases.
  • If the number of contents are too small comparing to the size of hash table then it simply wastes the memory space that hash table occupies.

Thus if there are too much of gab between the number of contents and size of hash table, you need to re-size the hash table. If hash table is too small then you need to enlarge it or the other way around.

For example, if the size of hash table is 3 times bigger than the number of contents or small as less than 10% of contents then you need to re-size it. The appropriate proportion would be for the number of contents to be 75% of the size of hash table. The hash table being 3 times bigger can be considered as maximum load, less than 10% as minimum load, and 75% as optimal load.

If you want to control such load of map, you can do so with Proud.CFastMap.CFastMap or Proud.CFastMap.SetOptimalLoad.