previous | start | next

Table Size, Load Factor and Caches

For separate chaining, we can make the load factor smaller and smaller by increasing the number of chains.

Keys will be spread out further on different chains.

This randomness is not necessarily good for memory cache performance. Accessing one chain may bring a portion of the chain array into the L1 cache. But the next chain accessed may not be in the same cache block resulting in a cache miss.

This randomness may result in worse performance because of increased cache misses.

Moral: Don't make the number of chains excessively large.



previous | start | next