From ffad2bc49e26d38af0131bd622d7bcbebf133473 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 24 Sep 2022 22:03:16 +0200 Subject: [PATCH] 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. --- lisp/doom-ui.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/doom-ui.el b/lisp/doom-ui.el index 0b3060467..534c7e8cb 100644 --- a/lisp/doom-ui.el +++ b/lisp/doom-ui.el @@ -610,9 +610,10 @@ triggering hooks during startup." (add-hook hook #'doom-init-fonts-h -100) (add-hook hook #'doom-init-theme-h -90)) -;; Initialize UI as late as possible. `window-buffer-change-functions' runs -;; once, when the scratch/dashboard buffer is first displayed. -(add-hook 'doom-after-init-hook #'doom-init-ui-h -100) +;; PERF: Init UI late, but not too late. Its impact on startup time seems to +;; vary wildly depending on exact placement. `window-setup-hook' appears to be +;; the sweet spot. +(add-hook 'window-setup-hook #'doom-init-ui-h -100) ;;