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

Significant lag when adding or deleting a line in case there is a breakpoint bellow #20485

Closed
Ignasijus opened this issue Feb 6, 2023 · 7 comments

Comments

@Ignasijus
Copy link

Ignasijus commented Feb 6, 2023

Problem Description

In case there are breakpoints in the code editor, creating a new line or deleting a line anywhere above a breakpoint takes about a second, i.e., there is a significant lag.

This bug is not specific to this newest version of Spyder (5.4.2), it was also present in previous versions. I cannot believe it is still not fixed. It makes working with Spyder very frustrating.

I installed the latest Spyder version in a separate environment.

What steps reproduce the problem?

  1. Open or create a file with some code.
  2. Add a breakpoint on some line.
  3. Press enter or ctr+d somewhere above the breakpoint and experience a one second lag.

These steps may not reproduce the problem because it may be related to some specific Spyder settings. But it is probably related to other issues reported about such lag, e.g., #10992.

Versions

  • Spyder version: 5.4.2.
  • Python version: 3.9
  • Operating System name/version: Windows 10

Dependencies

Mandatory:
atomicwrites >=1.2.0 : 1.4.1 (OK)
chardet >=2.0.0 : 5.1.0 (OK)
cloudpickle >=0.5.0 : 2.2.1 (OK)
cookiecutter >=1.6.0 : 2.1.1 (OK)
diff_match_patch >=20181111 : 20200713 (OK)
intervaltree >=3.0.2 : 3.0.2 (OK)
IPython >=7.31.1;<9.0.0 : 8.9.0 (OK)
jedi >=0.17.2;<0.19.0 : 0.18.2 (OK)
jellyfish >=0.7 : 0.9.0 (OK)
jsonschema >=3.2.0 : 4.17.3 (OK)
keyring >=17.0.0 : 23.13.1 (OK)
nbconvert >=4.0 : 7.2.9 (OK)
numpydoc >=0.6.0 : 1.5.0 (OK)
paramiko >=2.4.0 : 3.0.0 (OK)
parso >=0.7.0;<0.9.0 : 0.8.3 (OK)
pexpect >=4.4.0 : 4.8.0 (OK)
pickleshare >=0.4 : 0.7.5 (OK)
psutil >=5.3 : 5.9.4 (OK)
pygments >=2.0 : 2.14.0 (OK)
pylint >=2.5.0;<3.0 : 2.16.1 (OK)
pylint_venv >=2.1.1 : 2.3.0 (OK)
pyls_spyder >=0.4.0 : 0.4.0 (OK)
pylsp >=1.7.1;<1.8.0 : 1.7.1 (OK)
pylsp_black >=1.2.0 : 1.2.1 (OK)
qdarkstyle >=3.0.2;<3.1.0 : 3.0.3 (OK)
qstylizer >=0.2.2 : 0.2.2 (OK)
qtawesome >=1.2.1 : 1.2.2 (OK)
qtconsole >=5.4.0;<5.5.0 : 5.4.0 (OK)
qtpy >=2.1.0 : 2.3.0 (OK)
rtree >=0.9.7 : 1.0.1 (OK)
setuptools >=49.6.0 : 67.1.0 (OK)
sphinx >=0.6.6 : 6.1.3 (OK)
spyder_kernels >=2.4.2;<2.5.0 : 2.4.2 (OK)
textdistance >=4.2.0 : 4.5.0 (OK)
three_merge >=0.1.1 : 0.1.1 (OK)
watchdog >=0.10.3 : 2.2.1 (OK)
zmq >=22.1.0 : 25.0.0 (OK)

Optional:
cython >=0.21 : None (NOK)
matplotlib >=3.0.0 : None (NOK)
numpy >=1.7 : None (NOK)
pandas >=1.1.1 : None (NOK)
scipy >=0.17.0 : None (NOK)
sympy >=0.7.3 : None (NOK)

@ryanewood1
Copy link

I have this same issue! Just reproduced by adding and removing breakpoint. Any assistance is greatly appreciated

@dalthviz
Copy link
Member

Hi @Ignasijus and @ryanewood1 thank you for the feedback! So as a first suggestion I would say that checking if you have the latest Spyder version (5.4.3) could be nice. However, as mentioned in the OP I think Editor performance issues have been around in Spyder for some time now :/. Following the linked issue in the OP, could it be that you have several more or less big files (~4k-5k lines) open at the same time when the lag happens? Also, do you have any Editor functionality enabled (like the options you can enable/disable from the Source menu or from the Editor preferences) along side setting the breakpoints? Also, how many breakpoints are being set? Any other info (steps, code examples, etc) to be able to reproduce locally and debug this is greatly appreciated!

@ryanewood1
Copy link

@dalthviz Thanks for your help with this one! The issue comes up even with a ~200 line file open (and only one other 20-line file open) with ~3 breakpoints. I have turned off nearly all non-critical editor functionality (linting, ect) but it does not help. Tried changing from dark mode to light without any luck.

Let me know if any other info I can provide, ect

@dalthviz
Copy link
Member

Thank you for the new info @ryanewood1 ! I'm not being able to reproduce this :/ Could it be possible for you to try to reset Spyder to default settings and check if that helps? and maybe before that get a copy of your spyder preferences and run Spyder on debug mode?:

  • The spyder preferences and config are located at <path to user/home dir>/.spyder-py3

  • To reset Spyder you can go to Tools >Reset Spyder to factory defaults

  • To run Spyder on debug mode you will need to go to File > Restart in debug mode > Verbose, that should generated a log file named spyder-debug.log at your local .spyder-py3 dir

@ryanewood1
Copy link

SpyderDebug.zip

Thanks, @dalthviz ! I repeated the test and have included all the debug mode files above. I reset to factory defaults and it seems slightly better but will have to keep an eye on it. Thanks again for all your help!

@dalthviz
Copy link
Member

Thank you for the new info @ryanewood1 ! From what I see, seems like no errors or strange messages appear. However, I noticed that you are working with files inside a Onedrive directory, right? Not totally sure but, what happens if you try to edit files outside Onedrive? Is the lag the same for those files? Also, maybe disabling the Autosave feature for Spyder could help (the option is at Preferences > Editor > Advanced settings > Automatically save a copy of files with unsaved changes)?

Let us know!

@ccordoba12
Copy link
Member

Closing due to lack of response.

@ccordoba12 ccordoba12 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants