Skip to content
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

optimize PSet.intersect() #103

Open
2 tasks
hrldcpr opened this issue Sep 21, 2022 · 1 comment
Open
2 tasks

optimize PSet.intersect() #103

hrldcpr opened this issue Sep 21, 2022 · 1 comment

Comments

@hrldcpr
Copy link
Owner

hrldcpr commented Sep 21, 2022

  • 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
Copy link
Owner Author

hrldcpr commented Sep 21, 2022

(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…)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant