-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Hash up to 8 bytes at once with FxHasher #51019
Conversation
@bors try Let's do a perf check. cc @Mark-Simulacrum |
Hash up to 8 bytes at once with FxHasher r? @michaelwoerister
src/librustc_data_structures/fx.rs
Outdated
unsafe { | ||
assert!(size_of::<usize>() <= 8); | ||
while bytes.len() >= size_of::<usize>() { | ||
self.add_to_hash(*(bytes.as_ptr() as *const usize)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could cause unaligned reads.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@kennytm Can we restart that try build with the latest version of the PR? |
@bors try |
Hash up to 8 bytes at once with FxHasher r? @michaelwoerister
☀️ Test successful - status-travis |
Thanks, @kennytm! |
The hash implementation has been moved to an external crate, could we move this PR over to it's new home? |
Looks good to me. cc @nnethercote |
@Zoxc As mentioned in #51019 (comment), the FxHasher implementation has been moved out to Could you instead:
|
I've opened a PR to |
Version |
This now updates the |
📌 Commit 7ebd4d6 has been approved by |
Hash up to 8 bytes at once with FxHasher r? @michaelwoerister
☀️ Test successful - status-appveyor, status-travis |
r? @michaelwoerister