Skip to content

PERF: RangeIndex.append with the same index #57252

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 5 commits into from
Feb 9, 2024

Conversation

mroeschke
Copy link
Member

In [1]: import pandas as pd, numpy as np

In [2]: idx = pd.RangeIndex(1000)

In [3]: %timeit idx.append([idx] * 100_000)
362 ms ± 4.39 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)  # main
342 ms ± 4.07 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)  # pr

@mroeschke mroeschke added Performance Memory or execution speed performance Index Related to the Index class or subclasses labels Feb 4, 2024
@mroeschke mroeschke added this to the 3.0 milestone Feb 6, 2024
@phofl phofl merged commit 1564cf8 into pandas-dev:main Feb 9, 2024
@phofl
Copy link
Member

phofl commented Feb 9, 2024

thx @mroeschke

@mroeschke mroeschke deleted the ref/range/append branch February 9, 2024 21:31
pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this pull request May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Index Related to the Index class or subclasses Performance Memory or execution speed performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants