-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF: regression in IntervalIndex intersection #42240
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
Comments
(as I mentioned, this is a different issue as the one in #41929) |
Thank you for clarifying. |
The equivalent code from the benchmark mentioned above:
|
Profiling, looks like most of the time is taken up by a call to _get_join_target, which boils down to casting to object dtype. If I go into Index._intersection and change
then I see a runtime of 6.61ms, vs 163ms on master, so ever-so-slightly faster than 1.2.5. (this change passes the tests/indexes tests, havent run the full test suite) Will look into a less-kludgy solution. |
reopening as #42268 has not recovered all the performance regression
|
Huh, I get the same asv results, but when i run the worst one with %timeit i get much better perf |
94756fe seemed to be responsible for the majority of the slowdown |
but 1ff3b9a seems to be responsible for the majority of the slowdown in index_object.IntervalIndexMethod.time_intersection_one_duplicate(100000) |
Probably best to revert the offending PRs for 1.3 and i'll see about more robust solutions in 1.4 |
I didn't check the results properly here. The majority of the slowdown is also from 94756fe |
#42293 should fix here (need to verify) |
reopen to verify the results |
|
can probably close once we have official timings on the benchmark machine |
closing. can reopen if time_intersection_both_duplicate needs attention. cc @jbrockmendel |
https://simonjayhawkins.github.io/fantastic-dollop/#regressions?sort=3&dir=desc&branch=1.3.x |
There were several regressions related to the set op methods of IntervalIndex. For example #41929 (comment) which was fixed (and backported) in #42197.
But as far as I can see, that didn't fix the regression in https://pandas.pydata.org/speed/pandas/#index_object.IntervalIndexMethod.time_intersection?python=3.8&Cython=0.29.21&p-param1=100000&commits=de07087a-6f953a8c (50x slow down of
index_object.IntervalIndexMethod.time_intersection(100000)
)This one might be caused by one of the other interval index related commits in the range (#41832, #41824, #41883)
cc @jbrockmendel
The text was updated successfully, but these errors were encountered: