feat: increase garbage collection threshold always
This commit is contained in:
parent
f1f6b38b6c
commit
a581a36f55
1 changed files with 9 additions and 26 deletions
35
config.org
35
config.org
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
* TABLE OF CONTENTS :toc:
|
* TABLE OF CONTENTS :toc:
|
||||||
- [[#installation][Installation]]
|
- [[#installation][Installation]]
|
||||||
|
- [[#garbage-collection][Garbage collection]]
|
||||||
- [[#base-packages-to-install-first][Base packages to install first]]
|
- [[#base-packages-to-install-first][Base packages to install first]]
|
||||||
- [[#elpaca][Elpaca]]
|
- [[#elpaca][Elpaca]]
|
||||||
- [[#utils][Utils]]
|
- [[#utils][Utils]]
|
||||||
|
|
@ -23,7 +24,6 @@
|
||||||
- [[#macros][Macro's]]
|
- [[#macros][Macro's]]
|
||||||
- [[#goto-line][Goto-line]]
|
- [[#goto-line][Goto-line]]
|
||||||
- [[#rectangle][Rectangle]]
|
- [[#rectangle][Rectangle]]
|
||||||
- [[#garbage-collection-gc][Garbage collection (gc)]]
|
|
||||||
- [[#yes-or-no-questions][Yes-or-no questions]]
|
- [[#yes-or-no-questions][Yes-or-no questions]]
|
||||||
- [[#emacs-fullscreen-at-startup][Emacs fullscreen at startup]]
|
- [[#emacs-fullscreen-at-startup][Emacs fullscreen at startup]]
|
||||||
- [[#enable-disabled-commands][Enable disabled commands]]
|
- [[#enable-disabled-commands][Enable disabled commands]]
|
||||||
|
|
@ -116,8 +116,15 @@ This configuration requires the installation of :
|
||||||
=pip install jedi flake8 importmagic autopep8 yapf=
|
=pip install jedi flake8 importmagic autopep8 yapf=
|
||||||
- =ditaa= (for ascii to image generation in org-mode)
|
- =ditaa= (for ascii to image generation in org-mode)
|
||||||
|
|
||||||
* Base packages to install first
|
** Garbage collection
|
||||||
|
|
||||||
|
Increase GC threshold to minimize time wasting:
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(setq gc-cons-threshold 20000000) ;; 20 MB
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
|
* Base packages to install first
|
||||||
** Elpaca
|
** Elpaca
|
||||||
|
|
||||||
Replacement for built-in package manager package.el :
|
Replacement for built-in package manager package.el :
|
||||||
|
|
@ -442,30 +449,6 @@ so rebind it to something easy to remember.
|
||||||
(global-set-key (kbd "C-x r r") 'query-replace-regexp)
|
(global-set-key (kbd "C-x r r") 'query-replace-regexp)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Garbage collection (gc)
|
|
||||||
|
|
||||||
A lot of articles/sites/posts/... about this:
|
|
||||||
- [[https://lists.gnu.org/archive/html/help-gnu-emacs/2007-06/msg00243.html ]]
|
|
||||||
- https://bling.github.io/blog/2016/01/18/why-are-you-changing-gc-cons-threshold/
|
|
||||||
- ...
|
|
||||||
|
|
||||||
This just contains some hooks to stop/enable the GC at critical moments.
|
|
||||||
I'm not touching the value except during startup.
|
|
||||||
If I leave it too high, I got a lot of lag when using LSP mode, so just leave it at the default value.
|
|
||||||
|
|
||||||
I just 'Disable' GC in the minibuffer, I don't want lags/hangups/... in the minibuffer.
|
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
|
||||||
(defun my-minibuffer-setup-hook ()
|
|
||||||
(setq gc-cons-threshold most-positive-fixnum))
|
|
||||||
|
|
||||||
(defun my-minibuffer-exit-hook ()
|
|
||||||
(setq gc-cons-threshold 800000))
|
|
||||||
|
|
||||||
(add-hook 'minibuffer-setup-hook #'my-minibuffer-setup-hook)
|
|
||||||
(add-hook 'minibuffer-exit-hook #'my-minibuffer-exit-hook)
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
** Yes-or-no questions
|
** Yes-or-no questions
|
||||||
|
|
||||||
Because I'm lazy, important yes-or-no questions can be answered with y-or-n:
|
Because I'm lazy, important yes-or-no questions can be answered with y-or-n:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue