dotfiles/emacs-lisp/performance.org
magic_rb 9ee6c651be
Move performance optimizations into their own file
Signed-off-by: magic_rb <magic_rb@redalder.org>
2024-07-24 21:30:09 +02:00

34 lines
1 KiB
Org Mode

:PROPERTIES:
:header-args:emacs-lisp: :comments link :results none
:ID: 658bcc84-4814-4b84-a697-f71bf1a54e9c
:END:
#+title: Performance
#+filetags: emacs-load
Increase the amount of data Emacs reads from a process in one go, default is 4KB, but some LSP servers produce responses up to 24MB.
#+begin_src emacs-lisp
(when (boundp 'read-process-output-max)
(setq ; process-adaptive-read-buffering nil
read-process-output-max (* 24 1024 1024)))
#+end_src
Increase GC threshold to avoid random freezes on garbage collection.
#+NAME: gc-cons-threshold
#+BEGIN_SRC emacs-lisp :tangle no
(setq gc-cons-threshold (* 1024 1024 256))
#+END_SRC
Set the minimum delay between LSP refreshes, should help with performance when typing really fast.
#+NAME: lsp-idle-delay
#+BEGIN_SRC emacs-lisp :tangle no
(setq lsp-idle-delay 0.250)
#+END_SRC
Skip fontification on input, mostly helps with scrolling when Emacs cannot keep up withe fontification.
#+begin_src emacs-lisp
(setq redisplay-skip-fontification-on-input t)
#+end_src