Skip to content

Conversation

@lukemanley
Copy link
Member

Avoid hitting MultiIndex.values in is_bool_indexer.

from asv_bench.benchmarks.indexing import MultiIndexing
b = MultiIndexing()
b.setup(True)
%timeit b.time_loc_multiindex(True)

# 53.3 ms ± 2.18 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)   # <- main
# 28.6 ms ± 821 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)  # <- PR

@lukemanley lukemanley added Performance Memory or execution speed performance MultiIndex labels Nov 19, 2023
@lukemanley lukemanley added this to the 2.2 milestone Nov 19, 2023
@phofl phofl merged commit 6e5e393 into pandas-dev:main Nov 19, 2023
@phofl
Copy link
Member

phofl commented Nov 19, 2023

thx @lukemanley

@lukemanley lukemanley deleted the loc-with-multiindex branch November 22, 2023 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MultiIndex Performance Memory or execution speed performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants