dashmap
dashmap copied to clipboard
Missing basic set operations for HashSet
Using DashMap and DashSet realize that set operation difference is missing. Extracting all the entries and calculating it outside requires a bit of extra cpu cycles that probably can be avoided if implemented inside DashSet.
Other operations that are missing are intersection, union
This is something I did consider but I haven't prioritized since this isn't within the core use case of a dashset. They are mostly intended for set-like OLTP workloads and ops like intersections usually don't mix well with concurrent updates. Would you be better served by using a regular hashset here instead? We could maybe implement this under the ReadOnlyView API though but I don't think it makes much sense to have these under something that may be actively modified as the operation is running. What do you think?
I reworked my code to avoid the need for set operations, also got it to be more efficient... so, in my part I'm currently good.