🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Good default capacity and load factor for Hash Table?

Started by
1 comment, last by Shaarigan 4 years, 11 months ago

Hi everybody,
Java use for example a capacity of 16 and a load factor of 0.75 from what I read.
Is it a good default values? Any recommendation about it?
Thanks!

Advertisement

It depends on your implementation and the function. For speed reasons, I for example use a Power-of-Two capacity function and FNV hashing with a limited overflow. So i can set my factor to 0.90 and it is still in a good balance between finding a free slot and growing/rebalancing the hash-table.

I use hash-tables rarely in my game engine so the memory they consume isn't that important rather than their performance

This topic is closed to new replies.

Advertisement