-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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: Regression with indexing with ExtensionEngine #45652
Comments
Thanks for the report! I think this is a regression on the dev branch only, caused by #45514 (I commented there with a somewhat similar example, but using Int64 index instead of string).
That actually seems to be because of a bug, that it is in this case still using the object-dtype based Index/engine and therefore doesn't show the performance regression. pandas/pandas/core/indexes/base.py Lines 5906 to 5916 in c64fbce
if the |
Reopening this, since #46349 only added a bandaid specifically for strings, and as I mentioned above, this performance regression also applies to other uses of ExtensionEngine (eg Int64). |
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this issue exists on the latest version of pandas.
I have confirmed this issue exists on the main branch of pandas.
Reproducible Example
This only happens when indexing using dtype='string' on both the index and the indexer. Note here that
df.index
andstring_index
are bothdtype='string
. What is odd is that just accessing.values
or converting to a list will make indexing fast again. Old object indexes don't have the same issue.Installed Versions
INSTALLED VERSIONS
commit : c5ff649
python : 3.10.0.final.0
python-bits : 64
OS : Linux
OS-release : 5.16.0-arch1-1
Version : #1 SMP PREEMPT Mon, 10 Jan 2022 20:11:47 +0000
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.5.0.dev0+193.gc5ff649b11
numpy : 1.23.0.dev0+512.g6077afd65
pytz : 2021.3
dateutil : 2.8.2
pip : 21.3.1
setuptools : 58.5.3
Cython : 0.29.26
pytest : 6.2.5
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.7.1
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.0.3
IPython : 7.29.0
pandas_datareader: None
bs4 : 4.10.0
bottleneck : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : None
numba : 0.55.0dev0+1077.g0994f97c3
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 7.0.0.dev587+g458271315
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : 2.0.0b1
tables : None
tabulate : 0.8.9
xarray : None
xlrd : None
xlwt : None
zstandard : None
Prior Performance
No response
The text was updated successfully, but these errors were encountered: