-
Notifications
You must be signed in to change notification settings - Fork 21
VectorMap should cooperate with im/mutable HashMap/Sets/VectorMaps during addAll/removeAll/concat/removedAll etc. #11326
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
Comments
@joshlemer |
Excellent!
I think it would be a lot easier to wait until that one is merged, I think it might get weird with rebasing and force pushing if that branch needs to be changed, and then breaking what you are working on, but if you don't mind that, then go ahead! It should only be a very small few lines to change in VectorMap anyways. I think we should keep this separate maybe though, since that PR already deals with a lot already (4 different collections) |
Given the timing of RC1, starting asap would be good. We're still hoping to have all PRs merged by the end of Jan / mid Feb. |
As a performance optimization this could go into 2.13.1 but if you're planning to work on it you should make sure that it can be implemented in a binary compatible way. It may be necessary to relax access restrictions or add empty overrides in 2.13.0. |
@szeiger I'm not sure what we should do because according to discussion in scala/scala#7520 and #11369, we may be rethinking entirely how we do hashing. I don't think I have the expertise to say what hashing strategy we should use but once that decision is made, I or someone else can run with this ticket and scala/scala#7520. |
We're currently using different hash improvement algorithms because the implementations were developed independently. I can't think of a good reason why we should though. If all implementations can use the same algorithm there's no need for it to be reversible anymore. |
@szeiger we would still like it to be reversible so that mutable hashmaps/sets can share hashes when converting to immutable hashmaps/sets, because immutable hashmaps/sets require (as of now) original hashes |
What's the reason for needing both hashes? Why doesn't it always use the improved hash? |
After doing some digging I found the relevant Issue and PR: In the latter, @retronym states here:
So it is about efficiently producing |
Looks like this will slip? |
@adriaanm consider it slipped! |
Your mountain of merged collection PRs shouldn't become a slippery slope :-) #badmetaphors (At least I have the good sense to avoid sports metaphors.) |
Similar to the work done in scala/scala#7520, VectorMaps contain Maps (maybe we should change it to contain specifically HashMaps), which means that like in that PR, VectorMaps can join the club and avoid rehashing of elements during bulk add/remove transformations with those collections.
The text was updated successfully, but these errors were encountered: