Skip to content

PERF: IntervalArray.argsort #37971

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

Merged
merged 2 commits into from
Nov 21, 2020
Merged

Conversation

jbrockmendel
Copy link
Member

IntervalIndex.argsort has a more performant implementation (at least for default kwargs). This just moves that up to IntervalArray.

In [2]: idx = pd.IntervalIndex.from_breaks(range(10**4))

In [3]: arr = idx._data

In [4]: %timeit arr.argsort()
24.5 ms ± 458 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)     # <-- master
79 µs ± 1.64 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)   # <-- PR

@jreback jreback added Interval Interval data type Performance Memory or execution speed performance labels Nov 21, 2020
@jreback jreback added this to the 1.2 milestone Nov 21, 2020
@jreback jreback merged commit 10bee10 into pandas-dev:master Nov 21, 2020
@jreback
Copy link
Contributor

jreback commented Nov 21, 2020

do we have sufficient asv's for this?

@jbrockmendel
Copy link
Member Author

do we have sufficient asv's for this?

no, but itll be relatively easy to add mroe since there is a SortIntegerArray class that has a time_argsort, we can extend that

@jbrockmendel jbrockmendel deleted the ref-ia-argsort branch November 21, 2020 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Interval Interval data type Performance Memory or execution speed performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants