You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I just started using this package and it is great. My use case relies heavily on Complement and IsSuperSet with ~30k bits. I noticed that IsSuperSet is the only method in the "family" (Difference, Union, Intersection, Complement) not utilizing bitwise operations on set []uint64 so I forked the repo and changed the implementation.
Is there a specific reason for that? If not, I'm proposing a following solution. I'm not sure about the contributions policy, so I didn't send a PR but I could if that's OK with you.
I added some tests to make sure I'm not breaking anything, and ran some benchmarks to make sure I'm not making performance worse. Looks like it is significantly worse (+75%) only in case of all zeros (both sets are just 10k zero bits). See details below:
go install golang.org/x/perf/cmd/benchstat@latest
go test -bench=BenchmarkIsSuperSet -count 6 | Tee-Object -FilePath old.txt
go test -bench=BenchmarkIsSuperSet -count 6 | Tee-Object -FilePath new.txt
benchstat old.txt new.txt
Hi, I just started using this package and it is great. My use case relies heavily on
Complement
andIsSuperSet
with ~30k bits. I noticed thatIsSuperSet
is the only method in the "family" (Difference
,Union
,Intersection
,Complement
) not utilizing bitwise operations onset []uint64
so I forked the repo and changed the implementation.Is there a specific reason for that? If not, I'm proposing a following solution. I'm not sure about the contributions policy, so I didn't send a PR but I could if that's OK with you.
I added some tests to make sure I'm not breaking anything, and ran some benchmarks to make sure I'm not making performance worse. Looks like it is significantly worse (+75%) only in case of all zeros (both sets are just 10k zero bits). See details below:
The text was updated successfully, but these errors were encountered: