-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Include non-redundant separators in Hash
for Path
#127255
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Nilstrieb (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
cc @the8472 as I believe the regression was from your commit and you look quite active still. |
This comment has been minimized.
This comment has been minimized.
Ah I can reproduce that test failure locally — I was only testing |
tc!("foo/bar", "foobar", | ||
eq: false, | ||
starts_with: false, | ||
ends_with: false, | ||
relative_from: None | ||
); |
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 is the test case reported in the issue.
I'll take a look and will have to run some benchmarks to see the perf impact of this change, since that loop is fairly sensitive. |
Yeah, this regresses hashset performance
I'll see if I can find an alternative that satisfies the added tests. |
I took your tests and added a more lightweight fix in #127297 |
#127297 seems like a much better approach |
Improve std::Path's Hash quality by avoiding prefix collisions This adds a bit rotation to the already existing state so that the same sequence of characters chunked at different offsets into separate path components results in different hashes. The tests are from rust-lang#127255 Closes rust-lang#127254
Rollup merge of rust-lang#127297 - the8472:path-new-hash, r=Nilstrieb Improve std::Path's Hash quality by avoiding prefix collisions This adds a bit rotation to the already existing state so that the same sequence of characters chunked at different offsets into separate path components results in different hashes. The tests are from rust-lang#127255 Closes rust-lang#127254
Closes #127254, please see the issue for the details as I cover a lot there.
I'm not confident this is the clearest way to fix this, I'd appreciate some feedback.