0

When editing .el files my Emacs is very slow. The larger the file, the worse it behaves, it is especially visible while scrolling or using autocompletion of any kind. It becomes pretty visibly slow at +60 LOC. What's interesting, it only happens Emacs-Lisp mode, I also use Emacs to write Ruby, Elixir and Rust code and those behave just fine.

I went through with disabling the usual suspects, such as Flycheck, Flyspell and Company, but it did not improve a lot. Profiling also did not reveal any abnormal CPU or memory usage. I am using version 25.3 installed through hombrew.

Are there any less obvious things that might be causing this behavior?


Just in case, the list of minor modes for Emacs-Lisp mode are:

Enabled minor modes: Async-Bytecomp-Package Auto-Composition
Auto-Compression Auto-Encryption Auto-Revert Blink-Cursor
Column-Enforce Column-Number Company Completion-In-Region
Delete-Selection Diff-Auto-Refine Diff-Hl Diff-Hl-Flydiff
Diff-Hl-Margin Diff-Hl-Margin Display-Time Electric-Indent
Electric-Pair Evil Evil-Leader Evil-Local File-Name-Shadow Flycheck
Flyspell Font-Lock Global-Diff-Hl Global-Eldoc Global-Font-Lock
Global-Git-Commit Global-Linum Global-Undo-Tree Line-Number Linum
Magit-Auto-Revert Mouse-Wheel Projectile Purpose Rainbow
Rainbow-Delimiters Shell-Dirtrack Tooltip Transient-Mark Undo-Tree
Whitespace Yas Yas-Global

It is not particularly different from the one I am running for Elixir mode, yet Emacs-Lisp is considerably slower:

Enabled minor modes: Alchemist Async-Bytecomp-Package Auto-Composition
Auto-Compression Auto-Encryption Auto-Revert Blink-Cursor
Column-Enforce Column-Number Company Completion-In-Region
Delete-Selection Diff-Auto-Refine Diff-Hl Diff-Hl-Flydiff
Diff-Hl-Margin Diff-Hl-Margin Display-Time Electric-Indent
Electric-Pair Evil Evil-Leader Evil-Local File-Name-Shadow Flyspell
Font-Lock Global-Diff-Hl Global-Eldoc Global-Font-Lock
Global-Git-Commit Global-Linum Global-Undo-Tree Line-Number Linum
Magit-Auto-Revert Mouse-Wheel Projectile Purpose Rainbow
Rainbow-Delimiters Ruby-End Shell-Dirtrack Tooltip Transient-Mark
Undo-Tree Whitespace Yas Yas-Global
3
  • 2
    As usual, start by starting Emacs with emacs -Q (no init file). If you can reproduce it from that start then report a bug: M-x report-emacs-bug, providing a step-by-step recipe from emacs -Q. If you cannot repro it without your init file then recursively bisect your init file to find the culprit.
    – Drew
    Oct 28, 2017 at 19:32
  • 1
    Line number mode from the built-in linum.el uses line-number-at-pos, which is always slower in larger buffers and causes noticeable slow-down. emacs.stackexchange.com/questions/3821/… If you do not have linum-mode active in non-Lisp large buffers and you still experience the slow-down, then you have an additional problem contributing to the slow-down. In a nutshell, there is at least one (1) known culprit in your setup -- perhaps more. nlinum by Stefan is better, but not perfect since it still uses said function.
    – lawlist
    Oct 28, 2017 at 20:10
  • 1
    The pre-release of Emacs 26 and the current master branch have built-in line-numbers without a slow-down, and the minor-mode is called display-line-numbers-mode
    – lawlist
    Oct 28, 2017 at 20:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.