core: add dotspacemacs-gc-cons variable

This commit is contained in:
syl20bnr 2018-01-28 23:22:38 -05:00
parent 7f558084f1
commit 72c89df995
4 changed files with 18 additions and 12 deletions

View File

@ -55,6 +55,11 @@ exists. Otherwise, fallback to ~/.spacemacs"))
`+distributions'. For now available distributions are `spacemacs-base'
or `spacemacs'.")
(defvar dotspacemacs-gc-cons '(100000000 0.1)
"Set `gc-cons-threshold' and `gc-cons-percentage' when startup finishes.
This is an advanced option and should not be changed unless you suspect
performance issues due to garbage collection operations.")
(defvar dotspacemacs-elpa-https t
"If non nil ELPA repositories are contacted via HTTPS whenever it's
possible. Set it to nil if you have no way to use HTTPS in your

View File

@ -228,6 +228,8 @@ defer call using `spacemacs-post-user-config-hook'."
(configuration-layer/display-summary emacs-start-time)
(spacemacs-buffer//startup-hook)
(spacemacs/check-for-new-version nil spacemacs-version-check-interval)
(setq spacemacs-initialized t))))
(setq spacemacs-initialized t)
(setq gc-cons-threshold (car dotspacemacs-gc-cons)
gc-cons-percentage (cadr dotspacemacs-gc-cons)))))
(provide 'core-spacemacs)

View File

@ -99,9 +99,15 @@ It should only modify the values of Spacemacs settings."
;; (default 5)
dotspacemacs-elpa-timeout 5
;; Set `gc-cons-threshold' and `gc-cons-percentage' when startup finishes.
;; This is an advanced option and should not be changed unless you suspect
;; performance issues due to garbage collection operations.
;; (default '(100000000 0.1))
dotspacemacs-gc-cons '(100000000 0.1)
;; If non-nil then Spacelpa repository is the primary source to install
;; a locked version of packages. If nil then Spacemacs will install the lastest
;; version of packages from MELPA. (default nil)
;; a locked version of packages. If nil then Spacemacs will install the
;; lastest version of packages from MELPA. (default nil)
dotspacemacs-use-spacelpa nil
;; If non-nil then verify the signature for downloaded Spacelpa archives.

11
init.el
View File

@ -13,15 +13,8 @@
;; (package-initialize)
;; Avoid garbage collection during startup.
(setq gc-cons-threshold 402653184
gc-cons-percentage 0.6)
(add-hook 'emacs-startup-hook
(lambda ()
;; Increase gc-cons-threshold from default, depending on your system you may set it back to a
;; lower value in your dotfile (function `dotspacemacs/user-config')
(setq gc-cons-threshold 100000000
gc-cons-percentage 0.1)))
;; see `SPC h . dotspacemacs-gc-cons' for more info
(setq gc-cons-threshold 402653184 gc-cons-percentage 0.6)
(load-file (concat (file-name-directory load-file-name)
"core/core-versions.el"))
(load-file (concat (file-name-directory load-file-name)