Skip to content

CLN: Use new hashtables in libindex to avoid casting #37994

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
Nov 24, 2020

Conversation

jbrockmendel
Copy link
Member

Small, hard-to-measure perf improvement, since it only makes a difference on the first lookup:

In [2]: rng = pd.Index(range(50)).repeat(20).astype("category")
In [14]: %timeit rng._engine.clear_mapping(); rng.get_loc(40)
24.8 µs ± 624 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)  # <-- master
21.3 µs ± 296 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)  # <-- PR

@jreback jreback added the Clean label Nov 24, 2020
@jreback jreback added this to the 1.2 milestone Nov 24, 2020
@jreback jreback merged commit f9a079a into pandas-dev:master Nov 24, 2020
@jbrockmendel jbrockmendel deleted the ref-libindex branch November 24, 2020 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants