Skip to content

Performance regression in timeseries.SortIndex.time_sort_index #33917

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

Closed
TomAugspurger opened this issue May 1, 2020 · 0 comments · Fixed by #34192
Closed

Performance regression in timeseries.SortIndex.time_sort_index #33917

TomAugspurger opened this issue May 1, 2020 · 0 comments · Fixed by #34192
Labels
Datetime Datetime data dtype Performance Memory or execution speed performance Regression Functionality that used to work in a prior pandas version
Milestone

Comments

@TomAugspurger
Copy link
Contributor

import pandas as pd
import numpy as np

N = 10 ** 5
idx = pd.date_range(start="1/1/2000", periods=N, freq="s")
s = pd.Series(np.random.randn(N), index=idx)
%timeit s.sort_index()
# 1.0.2
108 µs ± 8.27 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)
# master
225 µs ± 8.36 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)

According to https://pandas.pydata.org/speed/pandas/index.html#timeseries.SortIndex.time_sort_index?p-monotonic=True&commits=f683473a156f032a64a1d7edcebde21c42a8702d-085860a49f3a87aa4e24b3115b50b85c4b3c5676, the first slow commit is #33755, which just bumps Cython in numpydev... So probably not actually that commit.

@TomAugspurger TomAugspurger added Datetime Datetime data dtype Performance Memory or execution speed performance Regression Functionality that used to work in a prior pandas version labels May 1, 2020
@TomAugspurger TomAugspurger added this to the 1.1 milestone May 1, 2020
jreback pushed a commit that referenced this issue Jun 3, 2020
* PERF: Remove unnecessary  copies in sorting functions

* Run tests

* Run tests

* Add asv

* Run black

* Remove asv

* Run tests

* Run tests

* Run tests

* Run tests

* Run tests

* Run tests

Co-authored-by: mproszewska <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Performance Memory or execution speed performance Regression Functionality that used to work in a prior pandas version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant