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

add categorical equality fast paths #6057

Closed
ritchie46 opened this issue Jan 5, 2023 · 5 comments · Fixed by #6085
Closed

add categorical equality fast paths #6057

ritchie46 opened this issue Jan 5, 2023 · 5 comments · Fixed by #6085
Assignees

Comments

@ritchie46
Copy link
Member

A few easy perf/memory wins.

  • cat == str should first check the rev map.
  • cat.is_in should first check the rev_map if is_in is reasonable sized.
  • First global rev map doesn't need a map from global to local.
@ritchie46 ritchie46 self-assigned this Jan 5, 2023
@alexander-beedie
Copy link
Collaborator

alexander-beedie commented Jan 5, 2023

We've been moving a lot of data into Categorical cols recently, so this sounds fantastic :)

@ritchie46
Copy link
Member Author

Tried the smaller rev-map, but that seems more trouble than it is worth. We cannot determine fast uniques in such a case and get regressions in string comparisons. I will go with equality fast paths.

@ghuls
Copy link
Collaborator

ghuls commented Jan 5, 2023

Wouldn't a bloom filter be a good alternative for a fast in set reduction approach?

@ritchie46
Copy link
Member Author

Wouldn't a bloom filter be a good alternative for a fast in set reduction approach?

Yes, but we also need to map from global idx to local one. Don't want to do a linear search once the bloom filter says yes.

@ritchie46
Copy link
Member Author

Will go for a btree. They are much more condensed and likely to be much faster on u32.

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

Successfully merging a pull request may close this issue.

3 participants