Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/fixed_containers/fixed_robinhood_hashtable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,10 @@ class FixedRobinhoodHashtable

constexpr std::size_t default_bucket_count(std::size_t value_count)
{
// oversize the bucket array by 30%
// Oversize the bucket array by 30% to reduce collisions as the container becomes full.
// TODO: think about the oversize percentage
// TODO: round to a nearby power of 2 to improve modulus performance
return (value_count * 130) / 100;
// Additionally, use the next power of 2 to improve modulo runtime efficiency.
return std::bit_ceil((value_count * 130) / 100);
}

} // namespace fixed_containers::fixed_robinhood_hashtable_detail
Loading