From 7a6a0eb0c09fa4df296435187516467dcaf0e52a Mon Sep 17 00:00:00 2001 From: eriedaberrie Date: Fri, 6 Jan 2023 23:36:09 -0800 Subject: [PATCH] Expand early-init.el, manual gcmh, remove nativecomp warnings --- early-init.el | 17 +++++++++++++++++ init.el | 5 ----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/early-init.el b/early-init.el index 37b80ba..65b0730 100644 --- a/early-init.el +++ b/early-init.el @@ -1,5 +1,22 @@ ;;; EMACS early-init file -*- lexical-binding:t -*- +;; Manual implementation of gcmh as soon as possible (stolen from lambda emacs) +(setq gc-cons-threshold (* 300 1024 1024)) ; 300 MB +(defmacro k-time (&rest body) + "Measure and return the time it takes evaluating BODY." + `(let ((time (current-time))) + ,@body + (float-time (time-since time)))) +;; 15 sec gc loop when idle +(run-with-idle-timer 15 t + (lambda () + (let ((inhibit-message t)) + (message "Garbage Collector ran for %.06fsec" + (k-time (garbage-collect)))))) + ;; Set frame parameters early (setq default-frame-alist '((font . "JetbrainsMono Nerd Font-10.5") (alpha-background . 0.94))) + +;; Annoyoing comp errors +(setq native-comp-async-report-warnings-errors 'silent) diff --git a/init.el b/init.el index 605af1c..d2c450c 100644 --- a/init.el +++ b/init.el @@ -10,11 +10,6 @@ use-package-expand-minimally t) (require 'use-package) -(use-package gcmh - :demand t - :config - (gcmh-mode)) - (let ((emacs-tmp-dir (expand-file-name (format "emacs%d" (user-uid)) temporary-file-directory))) (setq auto-save-file-name-transforms `((".*" ,emacs-tmp-dir t))