Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unordered_map,unordered_set: Improve robustness of Fibonacci Hashing #111

Merged
merged 2 commits into from
Feb 26, 2020

Conversation

stotko
Copy link
Owner

@stotko stotko commented Feb 26, 2020

The mapping from hash values to bucket indices either uses Division Hashing (via modulus) or Fibonacci Hashing. However, since the latter requires attention for some corner cases, its logic needs to be more sophisticated. Factor this logic into a dedicated function and handle these cases more clearly. Furthermore, improve its robustness by applying a mixing operation to the input hash value and add a unit test for the bucket hit distribution.

@stotko stotko added this to the 1.3.0 milestone Feb 26, 2020
@stotko stotko merged commit 75dda24 into master Feb 26, 2020
@stotko stotko deleted the unordered_map_set_fibonacci_hashing branch February 26, 2020 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant