spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.22k stars 1.59k forks source link

Spyder randomly freezes when editing large Python files #21637

Open Chuck321123 opened 9 months ago

Chuck321123 commented 9 months ago

Issue Report Checklist

Checklist checked

Problem Description

So by working in a larger python file (about 8000 rows) by editing variables or adding text, Spyder randomly freezes in 1-2 seconds before it continues and it repeats every 5-10 seconds (and this happens before even running the script or have anything loaded). This didnt happen before so i find it strange that it happens suddenly, although i have in several occasions created new environments with spyder installed. I have tried a lot from reseting to factory settings and reinstalling Spyder to creating fresh new environment to reinstalling the whole anaconda and starting from scratch but nothing works. I have enough RAM and processing power available so it cant be that either. In jupyter everything runs fine.

What steps reproduce the problem?

It's kind of hard to replicate but i could manage to replicate 0.5-1 second freezes when editing code by just copy-pasting a random code with text so many times that the script reaches 20-30k lines. More than that i dont know how to attack the problem and i dont know what causes the problem.

Edit: Found the problem to come from the plugin "Completion and lintin". This plugin uses way too much CPU for me and disabling this has stopped the freezing. Might be a good idea to check into this

What is the expected output? What do you see instead?

That Spyder doesnt randomly freeze

Versions

Dependencies

# Mandatory:
atomicwrites >=1.2.0                                                        :  1.4.1 (OK)
chardet >=2.0.0                                                             :  5.2.0 (OK)
cloudpickle >=0.5.0                                                         :  3.0.0 (OK)
cookiecutter >=1.6.0                                                        :  2.5.0 (OK)
diff_match_patch >=20181111                                                 :  20230430 (OK)
intervaltree >=3.0.2                                                        :  3.1.0 (OK)
IPython >=7.31.1,<9.0.0,!=8.8.0,!=8.9.0,!=8.10.0,!=8.11.0,!=8.12.0,!=8.12.1 :  8.18.0 (OK)
jedi >=0.17.2,<0.19.0                                                       :  0.18.2 (OK)
jellyfish >=0.7                                                             :  1.0.3 (OK)
jsonschema >=3.2.0                                                          :  4.20.0 (OK)
keyring >=17.0.0                                                            :  24.3.0 (OK)
nbconvert >=4.0                                                             :  7.12.0 (OK)
numpydoc >=0.6.0                                                            :  1.6.0 (OK)
paramiko >=2.4.0                                                            :  3.3.1 (OK)
parso >=0.7.0,<0.9.0                                                        :  0.8.3 (OK)
pexpect >=4.4.0                                                             :  4.9.0 (OK)
pickleshare >=0.4                                                           :  0.7.5 (OK)
psutil >=5.3                                                                :  5.9.7 (OK)
pygments >=2.0                                                              :  2.17.2 (OK)
pylint >=2.5.0,<3.0                                                         :  2.17.7 (OK)
pylint_venv >=3.0.2                                                         :  3.0.3 (OK)
pyls_spyder >=0.4.0                                                         :  0.4.0 (OK)
pylsp >=1.7.4,<1.8.0                                                        :  1.7.4 (OK)
pylsp_black >=1.2.0,<3.0.0                                                  :  1.3.0 (OK)
qdarkstyle >=3.0.2,<3.2.0                                                   :  3.1 (OK)
qstylizer >=0.2.2                                                           :  0.2.2 (OK)
qtawesome >=1.2.1                                                           :  1.3.0 (OK)
qtconsole >=5.4.2,<5.5.0                                                    :  5.4.4 (OK)
qtpy >=2.1.0                                                                :  2.4.1 (OK)
rtree >=0.9.7                                                               :  1.1.0 (OK)
setuptools >=49.6.0                                                         :  68.2.2 (OK)
sphinx >=0.6.6                                                              :  7.2.6 (OK)
spyder_kernels >=2.4.4,<2.5.0                                               :  2.4.4 (OK)
textdistance >=4.2.0                                                        :  4.6.0 (OK)
three_merge >=0.1.1                                                         :  0.1.1 (OK)
watchdog >=0.10.3                                                           :  3.0.0 (OK)
zmq >=22.1.0                                                                :  25.1.2 (OK)

# Optional:
cython >=0.21                                                               :  3.0.6 (OK)
matplotlib >=3.0.0                                                          :  3.8.2 (OK)
numpy >=1.7                                                                 :  1.26.2 (OK)
pandas >=1.1.1                                                              :  2.1.4 (OK)
scipy >=0.17.0                                                              :  1.11.4 (OK)
sympy >=0.7.3                                                               :  None (NOK)
ccordoba12 commented 8 months ago

Hey @Chuck321123, thanks for reporting. We've also noticed this, but the fix is not so simple (i.e. it involves many changes in several places). We'll start with some improvements in Spyder 6 and then continue making things better in later releases.

In the meantime, we recommend you to use another editor/IDE to edit large files.