tools/lsp: refactor +lsp-optimization-mode

This commit is contained in:
Henrik Lissner 2020-10-11 19:46:08 -04:00
parent ebc1e7092d
commit c344d40d15
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -19,8 +19,9 @@ killing and opening many LSP/eglot-powered buffers.")
"Deploys universal GC and IPC optimizations for `lsp-mode' and `eglot'."
:global t
:init-value nil
(if +lsp-optimization-mode
(progn
(if (not +lsp-optimization-mode)
(setq-default read-process-output-max +lsp--default-read-process-output-max
gcmh-high-cons-threshold +lsp--default-gcmh-high-cons-threshold)
(setq +lsp--default-read-process-output-max
(default-value 'read-process-output-max)
+lsp--default-gcmh-high-cons-threshold
@ -34,8 +35,6 @@ killing and opening many LSP/eglot-powered buffers.")
;; GC strategy, so we modify its variables rather than
;; `gc-cons-threshold' directly.
(setq-default gcmh-high-cons-threshold (* 2 +lsp--default-gcmh-high-cons-threshold)))
(setq-default read-process-output-max +lsp--default-read-process-output-max
gcmh-high-cons-threshold +lsp--default-gcmh-high-cons-threshold))
(gcmh-set-high-threshold))