Skip to content

PERF: clipping with scalar #41869

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 1 commit into from
Jun 9, 2021
Merged

PERF: clipping with scalar #41869

merged 1 commit into from
Jun 9, 2021

Conversation

TLouf
Copy link
Contributor

@TLouf TLouf commented Jun 8, 2021

Removes conversion of boolean series to array-like in _clip_with_scalar.

I may also add type annotations to _clip_with_scalar, let me know if that's welcome.

Removes conversion of boolean series to array-like
@simonjayhawkins simonjayhawkins added Performance Memory or execution speed performance Regression Functionality that used to work in a prior pandas version labels Jun 8, 2021
@simonjayhawkins
Copy link
Member

I may also add type annotations to _clip_with_scalar, let me know if that's welcome.

always welcome. separate PR OK

@jreback
Copy link
Contributor

jreback commented Jun 8, 2021

can you show the asv's on this.

@TLouf
Copy link
Contributor Author

TLouf commented Jun 9, 2021

Here it is:

[ 50.00%] · For pandas commit ef773a6d <time-clip-perf> (round 2/2):
[ 50.00%] ·· Benchmarking conda-py3.8-Cython0.29.21-jinja2-matplotlib-numba-numexpr-numpy-odfpy-openpyxl-pytables-pytest-scipy-sqlalchemy-xlrd-xlsxwriter-xlwt
[ 75.00%] ··· series_methods.Clip.time_clip                                   ok
[ 75.00%] ··· ======== =============
                 n                  
              -------- -------------
                 50       492±40μs  
                1000      502±30μs  
               100000   1.46±0.05ms 
              ======== =============

[ 75.00%] · For pandas commit 3f67dc33 <master> (round 2/2):
[ 75.00%] ·· Building for conda-py3.8-Cython0.29.21-jinja2-matplotlib-numba-numexpr-numpy-odfpy-openpyxl-pytables-pytest-scipy-sqlalchemy-xlrd-xlsxwriter-xlwt
[ 75.00%] ·· Benchmarking conda-py3.8-Cython0.29.21-jinja2-matplotlib-numba-numexpr-numpy-odfpy-openpyxl-pytables-pytest-scipy-sqlalchemy-xlrd-xlsxwriter-xlwt
[100.00%] ··· series_methods.Clip.time_clip                                   ok
[100.00%] ··· ======== =============
                 n                  
              -------- -------------
                 50       540±30μs  
                1000      611±40μs  
               100000   1.79±0.09ms 
              ======== =============

that we can also compare with before the regression:

[ 50.00%] · For pandas commit 4f3acf10 <stash~155> (round 2/2):
[ 50.00%] ·· Benchmarking conda-py3.8-Cython0.29.21-jinja2-matplotlib-numba-numexpr-numpy-odfpy-openpyxl-pytables-pytest-scipy-sqlalchemy-xlrd-xlsxwriter-xlwt
[ 75.00%] ··· series_methods.Clip.time_clip                                   ok
[ 75.00%] ··· ======== =============
                 n                  
              -------- -------------
                 50       411±40μs  
                1000      449±20μs  
               100000   1.56±0.06ms 
              ======== =============

@jreback jreback added this to the 1.3 milestone Jun 9, 2021
@jreback jreback merged commit 6f953a8 into pandas-dev:master Jun 9, 2021
@jreback
Copy link
Contributor

jreback commented Jun 9, 2021

thanks @TLouf

JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Jul 3, 2021
@TLouf TLouf deleted the time-clip-perf branch August 24, 2021 11:59
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 series_methods.Clip.time_clip
3 participants