5

I can't remember since when exactly, but Emacs is getting slow with basic operations (moving cursor around). It's not exactly slow, but feeling laggy.

Before I try and halven my configuration files step by step as suggested in many places, I was wondering if there was another way.

Here is what profiler-report says:

- ...                                   433  36%
   Automatic GC                         406  34%
 + helm-check-minibuffer-input           22   1%
 + company--perform                       3   0%
 + byte-compile-let                       1   0%
 + sp-skip-closing-pair                   1   0%
- command-execute                       426  36%
 - call-interactively                   426  36%
  + helm-M-x                            287  24%
  + next-line                           103   8%
  + previous-line                        16   1%
  + save-buffer                          10   0%
  + kill-ring-save                        3   0%
  + windmove-up                           3   0%
  + windmove-down                         2   0%
  + yank                                  1   0%
  + self-insert-command                   1   0%
- timer-event-handler                   153  13%
 - byte-code                            148  12%
  - apply                               148  12%
   + mouse-avoidance-fancy              112   9%
   + auto-revert-buffers                 21   1%
   + hl-paren-highlight                   4   0%
   + #<lambda 0x72a5c9c7f6e60>            1   0%
     jit-lock-context-fontify             1   0%
   + blink-cursor-start                   1   0%
   + company-echo-show                    1   0%
 + timer-activate-when-idle               2   0%
 + timer-inc-time                         2   0%
+ redisplay_internal (C function)        87   7%
+ delete-selection-pre-hook              45   3%
+ flycheck-error-list-highlight-errors   19   1%
  x-set-selection                         5   0%
+ deactivate-mark                         2   0%
+ flycheck-display-error-at-point-soon    2   0%
+ yas--post-command-handler               1   0%

I can't really identify what gives me that laggy feel, especially since I am merely moving point around.

2

Something you might try is increasing gc-cons-threshold - with packages like helm, they need more memory or might get slowed down - note that the garbage collector and helm take up most of your CPU time.

But if you set it too high, Emacs would freeze for some seconds when it finally garbage collects.

The default is 800kb - Spacemacs uses 100mb, so that's what I've been using -

(setq gc-cons-threshold 100000000) ; ie 100mb, default is 800kb

See also https://www.reddit.com/r/emacs/comments/41m7x3/why_are_you_changing_gcconsthreshold/

  • Either that, or updating packages did the trick. – Mathieu Marques Feb 22 '16 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.