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
Improve bad hash functions #91552
base: master
Are you sure you want to change the base?
Improve bad hash functions #91552
Conversation
How did you check for these collisions? |
Used code from this closed pr #72561. Only the check was for the constant 8 and I also used
I used projects such as https://github.com/godotengine/godot-demo-projects and also several of mine. |
Since these methods are used in the import pipeline any change to hash functions would need to be an upward upgrade to the import formats. |
How is it used? I didn't find any hash calls in the import and io directories related to my changes. Also in most cases, I changed hashers that are used only by hash structures. |
Didn't reduz do the opposite while rewriting HashMap for Godot 4? Edit: Nevermind, I was thinking about #62176 which doesn't swap the algorithms together; it just cleans them up. |
Working on #90082. When using the collision checker, I found that hash maps/sets with these hash functions do not work well and create a large number of collisions (max number of collisions is more than 13). So I improved the algorithm for their work. In most cases, I changed the hashing algorithm from
djb2
tomurmur3
. The maximum number of collisions after these changes decreased by 1.5 - 2 times.