 			  (float-time
 			    (time-subtract after-init-time before-init-time)))
 		  gcs-done)))
-
-;; Use a hook so we restore settings after init
-(add-hook 'after-init-hook
-	`(lambda ()
-	   (setq
-	     gc-cons-threshold  (* 800 1024)
-	     gc-cons-percentage 0.1)
-	   (garbage-collect)) t)
 
 ;; ======================================================================
 ;; Act I

;;; init.el --- Emmanuel Roubion's personal init file -*- lexical-binding: t; -*-
;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Emmanuel Roubion

;; Author: Emmanuel Roubion
;; URL: https://github.com/maanuair/dotfiles

;; This file is part of Emmanuel's Roubion dot files, released under

;; On other OSes:
;;   emacs -q --eval='(message "%s" (emacs-init-time))'

;; Currently, startup time in graphical macOS environment is:
;;   <even before>: 1.86 seconds, with 5 Cs
;;   2020-09:       2.49 seconds, with 11 GCs
;;   2021-01:       5.26 seconds, with 11 GCs
;;   2021-03:       1.15 seconds, with 14 GCs (on Apple Silicon M1)
;;   2021-10:       1.36 seconds, with 13 GCs (on Apple Silicon M1)

;; Avoid GC during Emacs startup. Garbage collection when Emacs loses focus.
;; Inspiration from https://github.com/narendraj9/dot-emacs/blob/master/init.el
(setq
  ;; The default is 800 kilobytes. Measured in bytes.
  gc-cons-threshold most-positive-fixnum

  ;; Portion of heap used for allocation. Defaults to 0.1.
  gc-cons-percentage 0.4)

;; Restore good defaults post startup
(add-hook 'after-init-hook
  (lambda () (setq
               gc-cons-threshold (* 10 1024 1024)
               gc-cons-percentage 0.1)))

;; Use a hook so the message doesn't get clobbered by other messages.
(add-hook 'emacs-startup-hook
