Skip to content

Conversation

topper-123
Copy link
Contributor

@topper-123 topper-123 commented Apr 29, 2023

>>> import pandas as pd
>>> arr = pd.array(np.arange(100_000), dtype="Int32")
>>> %%timeit
... arr.dtype
... del arr._cache["dtype"]
2.09 µs ± 14.2 ns per loop  # main
234 ns ± 0.237 ns per loop  # this PR

Discovered working on some performance issues with #52836.

@jbrockmendel
Copy link
Member

nice!

@phofl phofl added Performance Memory or execution speed performance NA - MaskedArrays Related to pd.NA and nullable extension arrays labels Apr 30, 2023
@phofl phofl added this to the 2.1 milestone Apr 30, 2023
@phofl phofl merged commit 37e9e06 into pandas-dev:main Apr 30, 2023
@phofl
Copy link
Member

phofl commented Apr 30, 2023

thx @topper-123

@topper-123 topper-123 deleted the perf_masked_dtypes branch April 30, 2023 12:28
topper-123 added a commit to topper-123/pandas that referenced this pull request May 7, 2023
Rylie-W pushed a commit to Rylie-W/pandas that referenced this pull request May 19, 2023
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NA - MaskedArrays Related to pd.NA and nullable extension arrays Performance Memory or execution speed performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants