Slightly faster incremental loading

This commit is contained in:
Henrik Lissner 2020-03-31 01:00:40 -04:00
parent 58f52de912
commit d1c2e7b234
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395

View File

@ -360,12 +360,12 @@ If you want to disable incremental loading altogether, either remove
`doom-incremental-first-idle-timer' to nil. Incremental loading does not occur `doom-incremental-first-idle-timer' to nil. Incremental loading does not occur
in daemon sessions (they are loaded immediately at startup).") in daemon sessions (they are loaded immediately at startup).")
(defvar doom-incremental-first-idle-timer 2 (defvar doom-incremental-first-idle-timer 2.0
"How long (in idle seconds) until incremental loading starts. "How long (in idle seconds) until incremental loading starts.
Set this to nil to disable incremental loading.") Set this to nil to disable incremental loading.")
(defvar doom-incremental-idle-timer 1.5 (defvar doom-incremental-idle-timer 0.75
"How long (in idle seconds) in between incrementally loading packages.") "How long (in idle seconds) in between incrementally loading packages.")
(defun doom-load-packages-incrementally (packages &optional now) (defun doom-load-packages-incrementally (packages &optional now)
@ -406,7 +406,7 @@ intervals."
If this is a daemon session, load them all immediately instead." If this is a daemon session, load them all immediately instead."
(if (daemonp) (if (daemonp)
(mapc #'require (cdr doom-incremental-packages)) (mapc #'require (cdr doom-incremental-packages))
(when (integerp doom-incremental-first-idle-timer) (when (numberp doom-incremental-first-idle-timer)
(run-with-idle-timer doom-incremental-first-idle-timer (run-with-idle-timer doom-incremental-first-idle-timer
nil #'doom-load-packages-incrementally nil #'doom-load-packages-incrementally
(cdr doom-incremental-packages) t)))) (cdr doom-incremental-packages) t))))