-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
RFC: Simpler array hashing #26022
Merged
Merged
RFC: Simpler array hashing #26022
Commits on Jul 9, 2018
-
Configuration menu - View commit details
-
Copy full SHA for a3c1024 - Browse repository at this point
Copy the full SHA a3c1024View commit details
Commits on Jul 10, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 5aae6ff - Browse repository at this point
Copy the full SHA 5aae6ffView commit details
Commits on Jul 11, 2018
-
New design: interleave fibonacci skips with finding non-repeating ele…
…ments Goal: Hash approximately log(N) entries with a higher density of hashed elements weighted towards the end and special consideration for repeated values. Colliding hashes will often subsequently be compared by equality -- and equality between arrays works elementwise forwards and is short-circuiting. This means that a collision between arrays that differ by elements at the beginning is cheaper than one where the difference is towards the end. Furthermore, blindly choosing log(N) entries from a sparse array will likely only choose the same element repeatedly (zero in this case). To achieve this, we work backwards, starting by hashing the last element of the array. After hashing each element, we skip the next `fibskip` elements, where `fibskip` is pulled from the Fibonacci sequence -- Fibonacci was chosen as a simple ~O(log(N)) algorithm that ensures we don't hit a common divisor of a dimension and only end up hashing one slice of the array (as might happen with powers of two). Finally, we find the next distinct value from the one we just hashed.
Configuration menu - View commit details
-
Copy full SHA for f16326f - Browse repository at this point
Copy the full SHA f16326fView commit details
Commits on Jul 13, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 0d72578 - Browse repository at this point
Copy the full SHA 0d72578View commit details
Commits on Jul 26, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 0e97f65 - Browse repository at this point
Copy the full SHA 0e97f65View commit details -
Configuration menu - View commit details
-
Copy full SHA for 42c8ea9 - Browse repository at this point
Copy the full SHA 42c8ea9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3d62fba - Browse repository at this point
Copy the full SHA 3d62fbaView commit details
Commits on Jul 27, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 5a99f4b - Browse repository at this point
Copy the full SHA 5a99f4bView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.