Indent guides makes the Editor extremely slow on large files
See original GitHub issueProblem Description
I’ve isolated the primary source of the slowness I was reporting earlier: it appears to be due to the Indent Guides, as it vanishes with them disabled and reappears with them enabled (particularly after closing/reopening the file).
The lags are directly proportional to file length in my testing; essentially unnoticeable on a 60 line file; tolerable but annoying on a 600 line file, and positively glacial on a 3000 line file (mainwindow.py). Turning off all the “Auto”, showing blank spaces, wrap lines, CPU/memory usage and all introspection/analysis features made no difference.
What steps reproduce the problem?
- Enable indent guides
- Open
mainwindow.py
from the Spyder repo - Observe the majestic spectacle of a glacier moving
Versions
- Spyder version: 4.0.0.dev0
386403ed52
- Python version: 3.7.2
- Qt version: 5.9.6
- PyQt5 version: 5.9.2
- Operating System: Windows 8.1
Dependencies
pygments >=2.0 : 2.3.1 (OK)
qdarkstyle >=2.6.4: 2.6.5 (OK)
sphinx >=0.6.6 : 1.8.4 (OK)
pyls >=0.19.0 : 0.21.5 (OK)
nbconvert >=4.0 : 5.4.0 (OK)
pandas >=0.13.1 : 0.24.1 (OK)
numpy >=1.7 : 1.15.4 (OK)
sympy >=0.7.3 : 1.3 (OK)
cython >=0.21 : 0.29.4 (OK)
qtconsole >=4.2.0 : 4.4.3 (OK)
IPython >=4.0 : 7.2.0 (OK)
matplotlib >=2.0.0: 3.0.2 (OK)
pylint >=0.25 : 2.2.2 (OK)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:18 (15 by maintainers)
Top Results From Across the Web
Massive performance drop when "Show indentation guides" is ...
Open a large file (>1500 lines) with rider; Scroll, input some text, etc. Result: Very laggy experience (0.5 FPS or so). Expected result:...
Read more >Fast highlight indent guides? : r/emacs - Reddit
I'm using doom emacs and turned on the indent guides package but it's extremely slow when I scroll in a file. Any way...
Read more >Visual Studio Code Intellisense is very slow - Stack Overflow
I'm using VS Code and it's wonderful is all areas but code completion, where it is usually just too slow to be of...
Read more >Large Text File Editor/Viewer - UltraEdit
This is probably the most important tweak you can make to improve performance when opening very large files. As mentioned above, UltraEdit is...
Read more >Frequently Asked Questions | Google Earth Engine
They can be found in the Task tab of the Code Editor. ... ingestion might never finish because the layout of such files...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ccordoba12 Pulling the latest master with #10782 applied and running PyLS 0.31.1, the latest available, the lag is still very bad with indent guides on, being only able to type 3.2 characters per second sustained even with one key on repeat over a 80 character, 0-indented line (300 ms per character), and there’s around a 1000 ms interaction lag on the first character or any other changes. When I turn indent guides off, I get almost exactly double the characters per second, 6.3, and less than half the first keystroke delay. If I then also disable linting, code style warnings, and real-time code completion (which isn’t triggering here, since there’s no idle delay), things only improve a modest amount, to 6.9 max characters typed per second, with about the same small but noticeable interaction delay. For reference, in other editors (e.g. Notepad++), the rate at which I can type is 40+ chars per second with no interaction delay, limited only by keyboard repeat rate.
I can’t find the original thread (not sure why I didn’t link it here) where I did a ton of benchmarks, but from what I recall, this is closely in line with my previous findings, and has major usability impacts.
Nope, not on either platform.
Sure. All on clean prefs, averaged over all 8 threads:
No IG, Idle: 10-15% No IG, Scroll: 15-20% No IG, Typing: 20-25%
IG on, Idle: 15-20% IG on, Scroll: 20-25% IG on, Typing: 25-40%
The increase isn’t huge or consistent, but it does seem to be present.