diff --git a/core/siren-core-init.el b/core/siren-core-init.el index 4d98918..cf1b2af 100644 --- a/core/siren-core-init.el +++ b/core/siren-core-init.el @@ -36,6 +36,7 @@ ;; Continue core stuff (require 'siren-core-packages) +(require 'siren-core-performance) (require 'siren-core-env) (require 'siren-core-ui) (require 'siren-core-editor) diff --git a/core/siren-core-performance.el b/core/siren-core-performance.el new file mode 100644 index 0000000..f0de02e --- /dev/null +++ b/core/siren-core-performance.el @@ -0,0 +1,20 @@ +;;; siren-core-performance.el --- jimeh's Emacs Siren: Performance tweaks + +;;; Commentary: + +;; Performance tweaks. + +;;; Code: + +;; Setup and use gcmh-mode for improved garbage collection. +(use-package gcmh + :hook + (emacs-startup . (lambda() (gcmh-mode +1))) + (focus-out-hook . gcmh-idle-garbage-collect) + + :custom + (gcmh-idle-delay 10) + (gcmh-high-cons-threshold 16777216)) + +(provide 'siren-core-performance) +;;; siren-core-performance.el ends here diff --git a/early-init.el b/early-init.el index 9ebdb46..e16720d 100644 --- a/early-init.el +++ b/early-init.el @@ -6,8 +6,22 @@ ;;; Code: +;; Defer garbage collection further back in the startup process +(setq gc-cons-threshold most-positive-fixnum) + ;; Disable Emacs 27's automatic package.el initialization before the init.el ;; file is loaded. I use straight.el instead of package.el. (setq package-enable-at-startup nil) +;; Prevent the glimpse of un-styled Emacs by disabling these UI elements early. +(setq tool-bar-mode nil + menu-bar-mode nil) +(when (fboundp 'set-scroll-bar-mode) + (set-scroll-bar-mode nil)) + +;; Resizing the Emacs frame can be a terribly expensive part of changing the +;; font. By inhibiting this, we easily halve startup times with fonts that are +;; larger than the system default. +(setq frame-inhibit-implied-resize t) + ;;; early-init.el ends here