perf: move doom-init-ui-h to window-setup-hook

This has little effect on startup time now, but seems to buy 100-200ms
with some 3.0 optimizations that will come soon.
This commit is contained in:
Henrik Lissner 2022-09-24 22:03:16 +02:00
parent 5f37069402
commit ffad2bc49e
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -610,9 +610,10 @@ triggering hooks during startup."
(add-hook hook #'doom-init-fonts-h -100) (add-hook hook #'doom-init-fonts-h -100)
(add-hook hook #'doom-init-theme-h -90)) (add-hook hook #'doom-init-theme-h -90))
;; Initialize UI as late as possible. `window-buffer-change-functions' runs ;; PERF: Init UI late, but not too late. Its impact on startup time seems to
;; once, when the scratch/dashboard buffer is first displayed. ;; vary wildly depending on exact placement. `window-setup-hook' appears to be
(add-hook 'doom-after-init-hook #'doom-init-ui-h -100) ;; the sweet spot.
(add-hook 'window-setup-hook #'doom-init-ui-h -100)
;; ;;