refactor: Reduce init time }:)

- Greatly increase gc-cons-threshold.  This is the biggest win of this commit, shaving off about 400 ms.  The GC runs a single time during init.
- Sprinkle a few `:defer t`s throughout.

wwwwfeat: Configure Orderless
This commit is contained in:
Madeleine Sydney
2025-01-13 11:39:51 -07:00
parent 224b2ee044
commit 55c3db8db5
4 changed files with 14 additions and 2 deletions

View File

@@ -2,3 +2,10 @@
;; Disable package.el; we use Straight.
(setq package-enable-at-startup nil)
;; Enable use-package statistics for the sake of start-up profiling.
(setq use-package-compute-statistics t)
(setq gc-cons-threshold
;; (4 gibibytes)
(* 4 (expt 1024 3)))

View File

@@ -28,6 +28,6 @@
(with-current-buffer url-buffer
(goto-char (point-max))
(eval-print-last-sexp))))
(load-file bootstrap-file))
(load bootstrap-file nil 'nomessage))
(setq straight-use-package-by-default t))

View File

@@ -78,6 +78,7 @@
:commands (evilnc-comment-operator
evilnc-inner-comment
evilnc-outer-commenter)
:defer t
:bind (:map evil-normal-state-map ("#" . evilnc-comment-operator)
:map evil-visual-state-map ("#" . evilnc-comment-operator)
:map evil-inner-text-objects-map ("c" . evilnc-inner-comment)
@@ -101,7 +102,8 @@
;; 'g=' is a bit more comfortable than 'g+', whilst preserving the analogy.
;; ('=' is '+' modulo shift)
:bind (:map evil-normal-state-map ("g=" . 'evil-numbers/inc-at-pt)
:map evil-normal-state-map ("g-" . 'evil-numbers/dec-at-pt)))
:map evil-normal-state-map ("g-" . 'evil-numbers/dec-at-pt))
:defer t)
;; Tree-sitter queries → Evil text objects.
(use-package evil-textobj-tree-sitter
@@ -121,6 +123,7 @@
(use-package evil-terminal-cursor-changer
;; This package is only useful in the terminal.
:if (not (display-graphic-p))
:defer t
:hook (on-first-input . evil-terminal-cursor-changer-activate))
;; Automatic alignment in region, by regexp.
@@ -152,6 +155,7 @@
;; the text `two words`, but the point is over `two`, Evil will search for
;; `two`. `evil-visualstar' will instead search for `two words`.
(use-package evil-visualstar
:defer t
:bind (:map evil-visual-state-map
("*" . evil-visualstar/begin-search-forward)))