perf: disable autoload-compute-prefixes & optimize var cache
- Batch more variables in Doom's autoloads files. - Remove all the register-definition-prefixes calls generated in autoloads files (for both modules' and packages' autoloads). These don't serve much purpose, and only incur added cost growing a large hash table.
This commit is contained in:
parent
16469f1f9d
commit
024048dd5e
3 changed files with 9 additions and 8 deletions
|
@ -722,6 +722,11 @@ original state.")
|
|||
if (string-match-p prompt-re prompt)
|
||||
return (string-match-p opt-re option)))
|
||||
|
||||
(defadvice! doom-cli--straight-no-compute-prefixes-a (fn &rest args)
|
||||
:around #'straight--build-autoloads
|
||||
(let (autoload-compute-prefixes)
|
||||
(apply fn args)))
|
||||
|
||||
(defadvice! doom-cli--straight-fallback-to-tty-prompt-a (fn prompt actions)
|
||||
"Modifies straight to prompt on the terminal when in noninteractive sessions."
|
||||
:around #'straight--popup-raw
|
||||
|
|
|
@ -362,10 +362,6 @@ Defaults to the profile at `doom-profile-default'."
|
|||
(signal 'doom-autoload-error (list init-file e))))))
|
||||
|
||||
(defun doom-profile--generate-init-vars ()
|
||||
(setq doom-autoloads-cached-vars '(load-path
|
||||
Info-directory-list
|
||||
auto-mode-alist
|
||||
interpreter-mode-alist))
|
||||
(let ((v (version-to-list doom-version))
|
||||
(ref (doom-call-process "git" "-C" (doom-path doom-emacs-dir) "rev-parse" "HEAD"))
|
||||
(branch (doom-call-process "git" "-C" (doom-path doom-emacs-dir) "branch" "--show-current")))
|
||||
|
|
|
@ -12,12 +12,11 @@ hoist buggy forms into autoloads.")
|
|||
"List of regexps whose matching files won't be indexed for autoloads.")
|
||||
|
||||
(defvar doom-autoloads-cached-vars
|
||||
'(doom-modules
|
||||
doom-disabled-packages
|
||||
native-comp-deferred-compilation-deny-list
|
||||
load-path
|
||||
'(load-path
|
||||
auto-mode-alist
|
||||
interpreter-mode-alist
|
||||
magic-mode-alist
|
||||
magic-fallback-mode-alist
|
||||
Info-directory-list)
|
||||
"A list of variables to be cached in `doom-autoloads-file'.")
|
||||
|
||||
|
@ -145,6 +144,7 @@ hoist buggy forms into autoloads.")
|
|||
(version-control 'never)
|
||||
case-fold-search ; reduce magic
|
||||
autoload-timestamps ; reduce noise in generated files
|
||||
autoload-compute-prefixes
|
||||
;; So `autoload-generate-file-autoloads' knows where to write it
|
||||
(generated-autoload-load-name (file-name-sans-extension file))
|
||||
(target-buffer (current-buffer))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue