improve speed

This commit is contained in:
Jesús 2021-02-01 16:14:38 -05:00
parent e07b3998a0
commit e66773991b
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766

34
init.el
View File

@ -20,6 +20,34 @@
(setq-default initial-scratch-message (setq-default initial-scratch-message
(concat ";; Happy hacking, " user-login-name " - Emacs loves you!\n\n")) (concat ";; Happy hacking, " user-login-name " - Emacs loves you!\n\n"))
(defvar before-user-init-time (current-time)
"Value of `current-time' when Emacs begins loading `user-init-file'.")
;;; Garbage Collector
(progn
;; Set this to true to find GC issues.
(setq garbage-collection-messages nil)
;; Increase the gc-cons-threshold to a very high number to decrease
;; the load and compile time. The value will be decreased
;; significantly after initialization to avoid long GC pauses during
;; normal usage.
(setq gc-cons-threshold 402653184
gc-cons-percentage 0.6)
;; Reset GC to normal values.
(add-hook 'emacs-startup-hook
(lambda ()
(message
"[STARTUP] Loading %s...done (%.3fs)" user-init-file
(float-time (time-subtract (current-time)
before-user-init-time)))
(when init-file-debug
(message "Rolling back GC settings to sane values."))
(setq gc-cons-threshold 16777216
gc-cons-percentage 0.1))))
;;; Modules directory ;;; Modules directory
(push (concat user-emacs-directory "modules") load-path) (push (concat user-emacs-directory "modules") load-path)
@ -98,12 +126,6 @@
(when (file-exists-p custom-file) (when (file-exists-p custom-file)
(load settings-file)) (load settings-file))
;; Time Output
(when window-system
(let ((elapsed (float-time (time-subtract (current-time)
emacs-load-start-time))))
(message "[STARTUP] Loading %s ... done (%.3fs)" load-file-name elapsed)))
;; enable erase-buffer command ;; enable erase-buffer command
(put 'erase-buffer 'disabled nil) (put 'erase-buffer 'disabled nil)