pcollections icon indicating copy to clipboard operation
pcollections copied to clipboard

optimize `PSet.intersect()`

Open hrldcpr opened this issue 3 years ago • 1 comments

  • [ ] if the passed list is a Set, then iterate over whichever set is smaller, so we get O(mlgn) complexity, with m<n
  • [ ] benchmark that this is actually faster

hrldcpr avatar Sep 21 '22 03:09 hrldcpr

(Also, is there a heuristic for plus-ing the intersection up from empty if it's small, versus minus-ing it down from full (as the current code does) if it's big? Probably nothing consistent…)

hrldcpr avatar Sep 21 '22 03:09 hrldcpr