-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
change AbstractString and Integer hashing to use generic hashing interface #59691
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
Merged
Conversation
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
Won't this be a massive slowdown as it goes from hashing word at a time to byte at a time? |
…rface Now that hashing has 3 interfaces (pointer (unsafe), array (indexable), iterable) in decreasing levels of typical optimization and performance, use those instead of making custom implementations for specific types. This automatically opts all AbstractString into fast hashing if they've correctly defined the `codeunit` string interface.
d254cdc
to
0e4af2d
Compare
No, the hash function is unchanged. The original PR adding these functions contains the benchmarks as well |
vtjnash
added a commit
that referenced
this pull request
Sep 30, 2025
This became unsound to use even though it was preserved "to avoid breakage" in v1.13, since continuing to use it would give incorrect hash results, which could result in corrupt dictionaries. Since #59691, these broken `hash` methods can now simply be deleted as they no longer provide any value. It is hard to say whether this is technically breaking or not as a change. It causes packages to go from giving subtly wrong answers (the worst kind of wrong) to crashing in v1.13, until the offending incorrect methods are deleted.
it is about 10x slower for big
|
xal-0
pushed a commit
to xal-0/julia
that referenced
this pull request
Sep 30, 2025
…rface (JuliaLang#59691) Now that hashing has 3 interfaces (pointer (unsafe), array (indexable), iterable) in decreasing levels of typical optimization and performance, use those instead of making custom implementations for specific types. This automatically opts all AbstractString into fast hashing if they've correctly defined the `codeunit` string interface.
vtjnash
added a commit
that referenced
this pull request
Oct 3, 2025
This became unsound to use even though it was preserved "to avoid breakage" in v1.13, since continuing to use it would give incorrect hash results, which could result in corrupt dictionaries. Since #59691, these broken `hash` methods can now simply be deleted as they no longer provide any value. It is hard to say whether this is technically breaking or not as a change. It causes packages to go from giving subtly wrong answers (the worst kind of wrong) to crashing in v1.13, until the offending incorrect methods are deleted.
vtjnash
added a commit
that referenced
this pull request
Oct 4, 2025
This became unsound to use even though it was preserved "to avoid breakage" in v1.13, since continuing to use it would give incorrect hash results, which could result in corrupt dictionaries and unsound programs. Since #59691, these broken `hash` methods in the ecosystem can now simply be deleted as they no longer provide any value. It is hard to say whether this is technically breaking or not as a change. It causes packages to go from giving subtly wrong answers (the worst kind of wrong) to crashing in v1.13, until the offending incorrect methods are deleted. n.b. this is expected to break several packages (notably among them, JuliaInterpreter, which has several tests specifically just for the existence of this global), which will require some ecosystem updates. The update should just be to delete the offending method (they is now redundant, undesirable, and have been giving unsafely buggy answers), but we need to do some work to identify those places and release new versions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Now that hashing has 3 interfaces (pointer (unsafe), array (indexable), iterable) in decreasing levels of typical optimization and performance, use those instead of making custom implementations for specific types. This automatically opts all AbstractString into fast hashing if they've correctly defined the
codeunit
string interface.