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: Replace get_loc calls in calc_dividend_ratios with get_indexer #1510

Merged
merged 5 commits into from Sep 22, 2016

Conversation

@yankees714
Copy link
Contributor

@yankees714 yankees714 commented Sep 22, 2016

We can make a single vectorized call outside of the loop, instead of repeatedly calling get_loc inside it.

Andrew Daniels added 3 commits Sep 22, 2016
We can make a single vectorized call outside of the loop, instead of
repeatedly calling get_loc inside it.
Andrew Daniels
@coveralls
Copy link

@coveralls coveralls commented Sep 22, 2016

Coverage Status

Coverage increased (+0.002%) to 86.55% when pulling 615a1c3 on calc-dividend-ratios-perf-regression into ac9d841 on master.


# Calculate locs against a tz-naive cal, as the ex_dates are tz-
# naive.
tz_naive_calendar = calendar.tz_localize(None)

This comment has been minimized.

@ssanderson

ssanderson Sep 22, 2016
Contributor

Rather than localizing the calendar to naive, can we localize the ex_dates to the calendar's time zone? They should be semantically identical, but using the same calendar prevents allocation of a new hash table.

This comment has been minimized.

@yankees714

yankees714 Sep 22, 2016
Author Contributor

Attempted this at first in 189b868, but get_indexer appears to drop the tz info, which throws off the comparison, so going with this workaround for now.

Andrew Daniels added 2 commits Sep 22, 2016
Andrew Daniels
Andrew Daniels
@coveralls
Copy link

@coveralls coveralls commented Sep 22, 2016

Coverage Status

Coverage increased (+0.002%) to 86.55% when pulling cb3254c on calc-dividend-ratios-perf-regression into ac9d841 on master.

@yankees714 yankees714 merged commit be0ecb6 into master Sep 22, 2016
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@yankees714 yankees714 deleted the calc-dividend-ratios-perf-regression branch Sep 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.