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: compare RangeIndex to equal RangeIndex #37130

Merged
merged 1 commit into from
Oct 15, 2020

Conversation

topper-123
Copy link
Contributor

@topper-123 topper-123 commented Oct 15, 2020

Fastpath for RangeIndexes with equal _range attribute.

Notice this works even if the RangeIndexes are not identical.

Example:

>>>  n = 100_000
>>> rng1 = pd.RangeIndex(n)
>>> rng2 = pd.RangeIndex(n)
>>> %timeit rng1 == rng2
374 µs ± 15.1 µs per loop  # master
10.4 µs ± 157 ns per loop  # this PR

Somewhat related to #37109

@jreback jreback added Index Related to the Index class or subclasses Numeric Operations Arithmetic, Comparison, and Logical operations Performance Memory or execution speed performance labels Oct 15, 2020
@jreback jreback modified the milestones: 2.0, 1.2 Oct 15, 2020
@jreback jreback merged commit 44d9b3a into pandas-dev:master Oct 15, 2020
@jreback
Copy link
Contributor

jreback commented Oct 15, 2020

thanks @topper-123

JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Oct 26, 2020
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
@topper-123 topper-123 deleted the perf_RangeIndex._cmp_method branch June 13, 2021 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Index Related to the Index class or subclasses Numeric Operations Arithmetic, Comparison, and Logical operations Performance Memory or execution speed performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants