Skip to content

PERF: get_loc #43862

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
Oct 3, 2021
Merged

PERF: get_loc #43862

merged 1 commit into from
Oct 3, 2021

Conversation

jbrockmendel
Copy link
Member

Fixes a perf regression from 1.2.x

from asv_bench.benchmarks.indexing import *
setup()
self = NumericSeriesIndexing()
self.setup(UInt64Index, "unique_monotonic_inc")

%timeit self.time_getitem_scalar(UInt64Index, "unique_monotonic_inc")
6.34 µs ± 257 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)  # <- PR
46.5 µs ± 724 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)  # <- 1.2.0
1.43 ms ± 36.9 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)  # <- master

%timeit self.time_loc_scalar(UInt64Index, "unique_monotonic_inc")
12.6 µs ± 163 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)  # <- PR
53.9 µs ± 1.1 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)  # <- 1.2.0
1.38 ms ± 5.33 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)  # <- master


%timeit self.time_loc_slice(UInt64Index, "unique_monotonic_inc")
32.5 µs ± 2.63 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)  # <- PR
75.6 µs ± 1.22 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)  # <- 1.2.0
1.41 ms ± 10.4 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)  # <- master

@jreback jreback added this to the 1.4 milestone Oct 3, 2021
@jreback jreback added Indexing Related to indexing on series/frames, not to indexes themselves Performance Memory or execution speed performance labels Oct 3, 2021
@jreback jreback merged commit 927d4ec into pandas-dev:master Oct 3, 2021
@jbrockmendel jbrockmendel deleted the perf-get_loc branch October 3, 2021 18:07
gasparitiago pushed a commit to gasparitiago/pandas that referenced this pull request Oct 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Indexing Related to indexing on series/frames, not to indexes themselves Performance Memory or execution speed performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants