mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
perf(startup): Improve startup speed by borrowing from doom-emacs
Shameless borrow various methods of improving Emacs startup time from
doom-emacs:
b0978a4526/docs/faq.org (how-does-doom-start-up-so-quickly)
This commit is contained in:
@@ -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)
|
||||
|
||||
20
core/siren-core-performance.el
Normal file
20
core/siren-core-performance.el
Normal file
@@ -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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user