5 ms·
Whenever I open a file of code that is ~2000 lines or more, emacs slows to a crawl. It takes 5 seconds to redraw the visible text after hitting "page up" or "pa
by creato 7y ago
Whenever I open a file of code that is ~2000 lines or more, emacs slows to a crawl. It takes 5 seconds to redraw the visible text after hitting "page up" or "page down".
I don't think emacs should be made any slower than it already is.
- dmortin 7y ago> Whenever I open a file of code that is ~2000 lines or more, emacs slows to a crawl. Then there is something wrong with your environment. Emacs has no problems with big files. It can have problems with very long lines, but big files shouldn't slow it down.
- fooker 7y agoI can reproduce this with emacs obtained from the repo on a newly installed Ubuntu 18.04 virtual machine.
- dmortin 7y agoThen I recommend M-x report-emacs-bug The emacs developers will be very interested to hear about it.
- slightwinder 7y agoThat's not true. Emacs has several problems with big files. Though, to be more specifically, built-in minor-modes have them. So it depends on whether you run a bleak vanilla emacs without anything, or a mildly comfortable emacs with at least something like fontlock-mode and stuff. But, 2000 lines are really not that much. Usually problems on my systems start to show at >10k lines.
- IronBacon 7y agoSyntax high-light pays its tool on not so huge files, but I remember opening without slowdowns files with around 100K lines in text mode (mostly log files). Not exactly related but with Emacs 27 will be distributed the so-long mode that could toggle minor modes that affect redrawing like "font-lock", "visual-line", "whitespace" when files with long lines are opened: https://git.savannah.nongnu.org/cgit/so-long.git/plain/so-long.el https://git.savannah.nongnu.org/cgit/so-long.git/plain/so-lo...
- IronBacon 7y agoClearly I meant "toll" not "tool" above...
- sachdevap 7y agoAs someone else has mentioned. Maybe the lines are very long. That is a known problem, and some minor solutions have been proposed, but it is an entrenched problem (in the way data structures handle text), and not one that programmers run into at any rate (unless you open those terrible "one-liner" javascript files).
- celeritascelery 7y agoThat is surprising. I open log files all the time with several million lines without issue. If you are having issues try running it in fundamental-mode.