Skip to content
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

PERF: Series.add for pyarrow string/binary dtypes #53150

Merged
merged 2 commits into from
May 9, 2023

Conversation

lukemanley
Copy link
Member

import pandas as pd
import pandas._testing as tm
import pyarrow as pa

N = 1_000_000
s1 = pd.Series(tm.makeStringIndex(N), dtype=pd.ArrowDtype(pa.string()))
s2 = pd.Series(tm.makeStringIndex(N), dtype=pd.ArrowDtype(pa.string()))

%timeit s1 + s2
# 136 ms ± 3.25 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)   -> main
# 61 ms ± 2.86 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)    -> PR

%timeit s1 + "abc"
# 200 ms ± 12.2 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)   -> main
# 64.5 ms ± 2.95 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)  -> PR

@lukemanley lukemanley added Performance Memory or execution speed performance Arrow pyarrow functionality labels May 9, 2023
@mroeschke mroeschke added this to the 2.1 milestone May 9, 2023
@mroeschke mroeschke merged commit b5f7984 into pandas-dev:main May 9, 2023
30 checks passed
@mroeschke
Copy link
Member

Nice thanks @lukemanley

Rylie-W pushed a commit to Rylie-W/pandas that referenced this pull request May 19, 2023
* PERF: Series.add for pyarrow string/binary dtypes

* whatsnew
@lukemanley lukemanley deleted the perf-add-arrow-string branch May 30, 2023 22:16
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
* PERF: Series.add for pyarrow string/binary dtypes

* whatsnew
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arrow pyarrow functionality Performance Memory or execution speed performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants