commit 25c15e3e88cdd6806dc7cd64e98af223e584a689
parent e4bd5b5e81bdaa93acd1fc5550c76537458bfea4
Author: andsy10 <andsy1016@gmail.com>
Date: Sat, 17 Oct 2026 23:33:28 +0800
Optimize startup speed
Diffstat:
3 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/early-init.el b/early-init.el
@@ -10,8 +10,21 @@
(setq gc-cons-threshold most-positive-fixnum))
;; from centaur emacs
-(defvar my--file-name-handler-alist file-name-handler-alist)
-(setq file-name-handler-alist nil)
+(let ((default-file-name-handler-alist file-name-handler-alist)
+ (default-load-suffixes load-suffixes)
+ (default-load-file-rep-suffixes load-file-rep-suffixes))
+ (setq file-name-handler-alist nil
+ load-suffixes '(".elc" ".el")
+ load-file-rep-suffixes '(""))
+ (add-hook 'emacs-startup-hook
+ (lambda ()
+ (setq load-suffixes default-load-suffixes
+ load-file-rep-suffixes default-load-file-rep-suffixes
+ file-name-handler-alist default-file-name-handler-alist))
+ 101))
+(when (boundp 'load-path-filter-function)
+ (setq load-path-filter-function #'load-path-filter-cache-directory-files))
+(setq load-prefer-newer noninteractive)
;; benchmark-init
(let ((benchmark-init-dir
diff --git a/init.el b/init.el
@@ -7,16 +7,6 @@
;;; Code:
-;; from centaur emacs
-;; restore file-name-hadler-alist
-(unless (or (daemonp) noninteractive init-file-debug)
- (add-hook 'emacs-startup-hook
- (lambda ()
- (setq file-name-handler-alist
- (delete-dups (append file-name-handler-alist
- my--file-name-handler-alist))))
- 101))
-
(add-to-list 'load-path
(expand-file-name (concat user-emacs-directory "lisp")))
diff --git a/lisp/init-startup.el b/lisp/init-startup.el
@@ -80,7 +80,6 @@
;; disabled commands
(put 'narrow-to-region 'disabled nil)
(put 'scroll-left 'disabled nil)
-
(setq enable-recursive-minibuffers t)
;; modifier keys on mac
@@ -106,5 +105,10 @@
(interactive)
(setq url-proxy-services nil))
+;; something else
+(setq inhibit-compacting-font-caches t
+ frame-inhibit-implied-resize t
+ frame-resize-pixelwise t)
+
(provide 'init-startup)
;;; init-startup.el ends here