Conversation
Member
|
Just curious, how does this stack up against the PR you closed? Cause the speedups you're showing here are amazing. |
Member
Author
|
I'm not sure. Probably better because we're relying on C code rather than re-implementing rules for StringDType operations in Python. |
Member
Author
|
I just quickly measured and they're actually about the same. The improvement is mostly algorithmic: the sorting path is O(nlogn) and the slow object path is O(N^2). But thank you for asking me to do this exercise because I see some marginal performance improvements. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR summary
Fixes #32161. Supersedes #32217.
This follows up on recent improvements to StringDType (in particular #32563 and #32464) to enable substantial performance improvements for
isin. Also adds more tests forisinin theStringDTypetests.Tests and benchmarks ran on an M1 MacBook Air using Python 3.14. The
pandas.NAcase uses pandas 3.0.5.main)Nonenp.nan"NA"object()pandas.NAFor
pandas.NA, the patch also fixes an error and correctly reports missing entries as non-matches. All returned results were checked against the expected membership mask.Each baseline was measured once; patched timings are the best of three runs. Input creation is excluded from the timings. Reproduce with
repeats=1on the baseline andrepeats=3on the patched build:AI Disclosure
I used an AI to iterate on this.