From 0ab6aba05664131117170a7a140587cb93918faa Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 18 Oct 2021 00:38:36 +0200 Subject: [PATCH] perf: inhibit redisplay/echo area at startup Unnecessary redraws can add 0.2-0.4s to startup times in some cases, especially where site-files are involved (which spam *Messages* with "Loading X..." messages; which force redraws). May also indirectly fix #5643 by deferring redisplay (and therefore window-buffer-change-functions, which triggers doom-init-ui-hook, which triggers both Doom's dashboard and persp-mode). Also removes a redundant set-language-environment call. Ref #5643 --- early-init.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/early-init.el b/early-init.el index 2f917797f..f06992ca8 100644 --- a/early-init.el +++ b/early-init.el @@ -41,9 +41,15 @@ old-file-name-handler-alist)))) (add-hook 'emacs-startup-hook #'doom-reset-file-handler-alist-h 101)) - ;; Contrary to what many Emacs users have in their configs, you don't need - ;; more than this to make UTF-8 the default coding system: - (set-language-environment "UTF-8")) + ;; Emacs really shouldn't be displaying anything until it has fully started + ;; up. This saves a bit of time. + (setq-default inhibit-redisplay t + inhibit-message t) + (add-hook 'window-setup-hook + (lambda () + (setq-default inhibit-redisplay nil + inhibit-message nil) + (redisplay)))) ;;