PERF: 100% CPU utilization with matplotlib (macosx) #58963
Labels
Needs Triage
Issue that has not been reviewed by a pandas team member
Performance
Memory or execution speed performance
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
machine: Mac (Intel) Ventura 13.6.6
python version: 3.12.3 (pyenv)
pandas version: 2.2.2 (pip)
matplotlib version: 3.9.0 (pip) (backend: macosx)
Problem: With matplotlib, pandas consumes 100% CPU.
Below code runs with reasonable CPU utilization; when the canvas was shown, almost no cpu utilization.
After closing the matplotlib window, simply importing pandas drives the CPU utilization 100%.
If I start the python interpreter, and running following code also consumes 100% of CPU:
The closest hint that I found was this: matplotlib/matplotlib#4092
I'm not sure but, I suspect that pandas' GUI backend initialization code (if any) for matplotlib (macosx backend) somehow creating this problem?
Without pandas, matplotlib's plot() alone does not cause high CPU utilization, so I post this here.
Installed Versions
pandas : 2.2.2
numpy : 1.26.4
pytz : 2024.1
dateutil : 2.9.0.post0
setuptools : None
pip : 24.0
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 5.2.2
html5lib : 1.1
pymysql : None
psycopg2 : None
jinja2 : None
IPython : None
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.12.3
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : 3.9.0
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : None
tzdata : 2024.1
qtpy : None
pyqt5 : None
Prior Performance
No response
The text was updated successfully, but these errors were encountered: