Skip to content

Performance regression in series_methods.Clip.time_clip #41434

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 12, 2021 · 4 comments · Fixed by #41869
Closed

Performance regression in series_methods.Clip.time_clip #41434

TomAugspurger opened this issue May 12, 2021 · 4 comments · Fixed by #41869
Labels
Benchmark Performance (ASV) benchmarks Performance Memory or execution speed performance Regression Functionality that used to work in a prior pandas version
Milestone

Comments

@TomAugspurger
Copy link
Contributor

https://pandas.pydata.org/speed/pandas/index.html#series_methods.Clip.time_clip?python=3.8&Cython=0.29.21&p-n=50&commits=29512dc9ea2b066ab5f4a7cb80c1f8f5becef1c2

#41141

I don't know if there's any easy way to get this back, but it'd be nice to avoid the slowdown if possible.

cc @Rasori

@TomAugspurger TomAugspurger added Performance Memory or execution speed performance Regression Functionality that used to work in a prior pandas version Benchmark Performance (ASV) benchmarks labels May 12, 2021
@TLouf
Copy link
Contributor

TLouf commented May 20, 2021

I think the .to_numpy conversion can safely be removed to improve performance, I've benchmarked it and got

       before           after         ratio
     [b2a36bdf]       [c02f0362]
     <master>         <perf-time-clip>
-        605±50μs         483±10μs     0.80  series_methods.Clip.time_clip(1000)

with all tests in "frame/methods/test_clip.py" and "series/methods/test_clip.py" still passing. If this sounds ok I can write a PR.

@simonjayhawkins simonjayhawkins added this to the 1.3 milestone May 24, 2021
@simonjayhawkins
Copy link
Member

@TLouf can you open a PR with the proposed changes

@TLouf TLouf mentioned this issue Jun 8, 2021
4 tasks
@TLouf
Copy link
Contributor

TLouf commented Jun 8, 2021

Done

@simonjayhawkins
Copy link
Member

Thanks @TLouf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Benchmark Performance (ASV) benchmarks 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.

3 participants