This repository was archived by the owner on Oct 12, 2022. It is now read-only.
core.internal.hash.bytesHash: in 64-bit builds use a 64-bit-oriented algorithm#3148
Open
n8sh wants to merge 1 commit intodlang:masterfrom
Open
core.internal.hash.bytesHash: in 64-bit builds use a 64-bit-oriented algorithm#3148n8sh wants to merge 1 commit intodlang:masterfrom
n8sh wants to merge 1 commit intodlang:masterfrom
Conversation
Contributor
|
Thanks for your pull request, @n8sh! Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + druntime#3148" |
b28789a to
077c6dc
Compare
Member
Author
Test runnable/testaa2.d failed:
expected:
----
foo()
foo() 2
foo() 3
foo() 4
c["foo"] = 3
c["bar"] = 4
Success
----
actual:
----
foo()
foo() 2
foo() 3
foo() 4
c["bar"] = 4
c["foo"] = 3
SuccessA DMD test is failing because it depends on a specific AA traversal order. I am inclined to consider that erroneous based on https://dlang.org/spec/hash-map.html:
|
Member
|
Indeed. This test should be fixed. |
This was referenced Jul 2, 2020
24e4042 to
4b0e672
Compare
Contributor
|
Please add a reference for this hash algorithm in a comment |
src/core/internal/hash.d
Outdated
Comment on lines
748
to
832
| version (BigEndian) | ||
| { | ||
| auto k1 = | ||
| ((cast(ulong) data[0]) << 56) | | ||
| ((cast(ulong) data[1]) << 48) | | ||
| ((cast(ulong) data[2]) << 40) | | ||
| ((cast(ulong) data[3]) << 32) | | ||
| ((cast(ulong) data[4]) << 24) | | ||
| ((cast(ulong) data[5]) << 16) | | ||
| ((cast(ulong) data[6]) << 8) | | ||
| (cast(ulong) data[7]); | ||
| } |
Contributor
There was a problem hiding this comment.
Couldn't this use the pointer read optimization as done for the 32 bit hash above?
35ad7df to
2fba8d3
Compare
…a 64-bit-oriented algorithm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Motivation: doesn't discard high 32 bits of seed; produces 64 bits of output; and is a bit faster.