8000 Fix performance issues when creating multiple instances of Period (#12903, #11831) by rs2 · Pull Request #12909 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

Fix performance issues when creating multiple instances of Period (#12903, #11831) #12909

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
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added asv benchmark for Period, PeriodIndex
  • Loading branch information
rs2 committed Apr 20, 2016
commit 1c5a2aba82f7d9667a9ceebe8082d47c623a0f8f
9 changes: 9 additions & 0 deletions asv_bench/benchmarks/period.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from pandas import Period, PeriodIndex, date_range


class create_period_index_from_date_range(object):
goal_time = 0.2

def time_period_index(self):
# Simulate irregular PeriodIndex
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a benchmark for #11831 as well (you can put in this file even though its plotting)

Copy link
Member

Choose a reason for hiding this comment

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

It's quite possible there is already a benchmark for this in the plotting benchmarks

Copy link
Contributor

Choose a reason for hiding this comment

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

ahh right, there prob is

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was Python 3.5.1 :: Anaconda 2.5.0 (64-bit)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I'm not committing any new benchmarks, but let me run them locally before and after the change...

PeriodIndex(date_range('1985', periods=10000).to_pydatetime(), freq='D')
Copy link
Contributor

Choose a reason for hiding this comment

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

just make this 1000 (it will be the same ratio, but the previous versions will take less time)

0