Skip to content
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

PERF: consolidate imports inside parse_time_string #24084

Merged
merged 1 commit into from Dec 5, 2018

Conversation

qwhelan
Copy link
Contributor

@qwhelan qwhelan commented Dec 4, 2018

This PR adds an asv benchmark for the creation of Period objects directly from integers, and an associated speedup for the same case.

When calling Period._from_ordinal(), the runtime is unfortunately dominated by a pair of import statements needed to pull in the global config settings display.date_dayfirst and display.date_yearfirst. Thus, simply consolidating them leads to a significant speedup:

Benchmarks that have improved:

       before           after         ratio
     [08395af4]       [696b40f1]
     <parse_time_string~1>       <parse_time_string>
-         176±3ms         98.7±3ms     0.56  period.PeriodIndexConstructor.time_from_ints('D')
  • closes #xxxx
  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

@pep8speaks
Copy link

Hello @qwhelan! Thanks for submitting the PR.

@codecov
Copy link

codecov bot commented Dec 4, 2018

Codecov Report

Merging #24084 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #24084   +/-   ##
=======================================
  Coverage   42.51%   42.51%           
=======================================
  Files         161      161           
  Lines       51689    51689           
=======================================
  Hits        21974    21974           
  Misses      29715    29715
Flag Coverage Δ
#single 42.51% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3fe697f...0f215ad. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 4, 2018

Codecov Report

Merging #24084 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #24084   +/-   ##
=======================================
  Coverage   92.21%   92.21%           
=======================================
  Files         161      161           
  Lines       51684    51684           
=======================================
  Hits        47658    47658           
  Misses       4026     4026
Flag Coverage Δ
#multiple 90.61% <ø> (ø) ⬆️
#single 43% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4b5f4d1...3e9370d. Read the comment docs.

@jreback jreback added the Performance Memory or execution speed performance label Dec 4, 2018
@jreback
Copy link
Contributor

jreback commented Dec 4, 2018

can you rebase on master; I think there might be an error in the benchmark (or if not the script should complete green, the CI has been fixed).

@jreback
Copy link
Contributor

jreback commented Dec 4, 2018

can you remove the warnings from asv/benchmarks/frame_methods and re-push. thanks.

@jreback jreback added this to the 0.24.0 milestone Dec 4, 2018
@qwhelan
Copy link
Contributor Author

qwhelan commented Dec 5, 2018

@jreback I believe the warnings in frame_methods were handled in another PR, so I've rebased again off master.

@jreback jreback merged commit 473f21a into pandas-dev:master Dec 5, 2018
@jreback
Copy link
Contributor

jreback commented Dec 5, 2018

thanks @qwhelan

Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants