mirror of
https://github.com/Foltik/dotfiles
synced 2024-11-24 04:22:50 -05:00
Add GC optimizations
This commit is contained in:
parent
659984a9ad
commit
eea3302ce3
@ -354,6 +354,14 @@ Print more stuff when running =C-x C-e= or =(eval-last-sexp)=
|
|||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq eval-expression-print-level 100)
|
(setq eval-expression-print-level 100)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
*** GC in Minibuffer
|
||||||
|
Don't garbage collect while the minibuffer is open, as heavy
|
||||||
|
things like completion and searches are happening and will
|
||||||
|
slow down with many garbage collections.
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(add-hook 'minibuffer-setup-hook #'jf-inhibit-gc)
|
||||||
|
(add-hook 'minibuffer-exit-hook #'jf-resume-gc)
|
||||||
|
#+END_SRC
|
||||||
** UI
|
** UI
|
||||||
*** Font
|
*** Font
|
||||||
Engage a nice coding font.
|
Engage a nice coding font.
|
||||||
@ -414,7 +422,10 @@ Show a cool custom dashboard buffer on startup.
|
|||||||
|
|
||||||
:custom
|
:custom
|
||||||
(dashboard-startup-banner 'logo)
|
(dashboard-startup-banner 'logo)
|
||||||
(dashboard-banner-logo-title "Welcome to Electronic Macs")
|
(dashboard-banner-logo-title
|
||||||
|
(format "Welcome to Electronic Macs. Ready in %.2f seconds with %d GCs."
|
||||||
|
(float-time (time-subtract after-init-time before-init-time))
|
||||||
|
gcs-done))
|
||||||
(dashboard-items
|
(dashboard-items
|
||||||
'((recents . 5)
|
'((recents . 5)
|
||||||
(agenda)
|
(agenda)
|
||||||
|
@ -4,6 +4,19 @@
|
|||||||
(defvar jf-config-file (expand-file-name "config.org" user-emacs-directory))
|
(defvar jf-config-file (expand-file-name "config.org" user-emacs-directory))
|
||||||
(defvar jf-init-file (expand-file-name "init.el" user-emacs-directory))
|
(defvar jf-init-file (expand-file-name "init.el" user-emacs-directory))
|
||||||
(defvar jf-load-path (expand-file-name "lisp/" user-emacs-directory))
|
(defvar jf-load-path (expand-file-name "lisp/" user-emacs-directory))
|
||||||
|
(defvar jf-gc-threshold 20000000) ; 20MB up from 800KB
|
||||||
|
|
||||||
(message "Initializing Electronic Macs...")
|
(defun jf-inhibit-gc ()
|
||||||
|
(setq gc-cons-threshold most-positive-fixnum))
|
||||||
|
(defun jf-resume-gc ()
|
||||||
|
(setq gc-cons-threshold jf-gc-threshold))
|
||||||
|
|
||||||
|
|
||||||
|
(message "-> Initializing Electronic Macs...")
|
||||||
|
|
||||||
|
;; Don't garbage collect during init
|
||||||
|
(jf-inhibit-gc)
|
||||||
(org-babel-load-file jf-config-file)
|
(org-babel-load-file jf-config-file)
|
||||||
|
(jf-resume-gc)
|
||||||
|
|
||||||
|
(message "-> Initialized in %s" (emacs-init-time))
|
||||||
|
Loading…
Reference in New Issue
Block a user