Skip to content

PERF: Fixed perf regression in TimedeltaIndex.get_loc #34734

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 3 commits into from
Jun 15, 2020

Conversation

TomAugspurger
Copy link
Contributor

Closes #34510

1.0.3

In [10]: index = pd.timedelta_range(start="1985", periods=1000, freq="D")
    ...: timedelta = index[500]
    ...:
    ...: %timeit index.get_loc(timedelta)

3.7 µs ± 275 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)

This PR

3.25 µs ± 67.7 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)

@TomAugspurger TomAugspurger added Performance Memory or execution speed performance Regression Functionality that used to work in a prior pandas version labels Jun 12, 2020
@TomAugspurger TomAugspurger added this to the 1.1 milestone Jun 12, 2020
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. @jbrockmendel if any comments

@jbrockmendel
Copy link
Member

LGTM

@@ -760,6 +760,7 @@ Deprecations
Performance improvements
~~~~~~~~~~~~~~~~~~~~~~~~

- Fixed performance regression in :meth:`TimedeltaIndex.get_loc` (:issue:`34510`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No whatsnew is needed, I think, the regression was only in master

@jreback
Copy link
Contributor

jreback commented Jun 15, 2020

lgtm

@jorisvandenbossche jorisvandenbossche merged commit ed1f7aa into pandas-dev:master Jun 15, 2020
@jorisvandenbossche
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Performance Memory or execution speed performance Regression Functionality that used to work in a prior pandas version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance regression in TimedeltaIndexing.time_get_loc
4 participants