Conversation

jbrockmendel

Implement ffill/bfill in terms of 'take', avoiding an object cast.

ser = pd.Series(range(10**5), dtype="int64[pyarrow]")
ser[5000] = pd.NA

%timeit ser.ffill()
609 µs ± 25.9 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)  # <- branch
5.49 ms ± 158 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)  # <- main

Some of the perf difference is likely due to no longer issuing a PerformanceWarning.

@jbrockmendeljbrockmendel requested a review from WillAyd as a code owner June 30, 2023 16:59
@phoflphofl added the PerformanceMemory or execution speed performancelabel Jul 2, 2023
@phoflphofl added this to the 2.1 milestone Jul 2, 2023
@phoflphofl merged commit 4da9cb6 into pandas-dev:main Jul 2, 2023
@phofl

thx @jbrockmendel

@jbrockmendeljbrockmendel deleted the perf-ea-pad branch July 2, 2023 21:42
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
Sign up for free to join this conversation on . Already have an account? Sign in to comment
PerformanceMemory or execution speed performance
None yet

Successfully merging this pull request may close these issues.