dashmap icon indicating copy to clipboard operation
dashmap copied to clipboard

Missing basic set operations for HashSet

Open snaggen opened this issue 4 years ago • 2 comments

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

snaggen avatar Nov 10 '21 11:11 snaggen

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?

xacrimon avatar Feb 06 '22 16:02 xacrimon

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.

snaggen avatar Feb 06 '22 18:02 snaggen