# HG changeset patch # User Oleksandr Gavenko # Date 1609621883 -7200 # Node ID 0bab53c47567de33315291faa277f0dfd91fbca2 # Parent 3f69332472cb5c4218b375082d49d4d2fb4ceafe Moved startup profiler settings to init.el and simplified activation. diff -r 3f69332472cb -r 0bab53c47567 .emacs-defs --- a/.emacs-defs Sat Jan 02 22:42:24 2021 +0200 +++ b/.emacs-defs Sat Jan 02 23:11:23 2021 +0200 @@ -1,5 +1,8 @@ ;; -*- mode: emacs-lisp; coding: utf-8; fill-column: 78; no-byte-compile: t; -*- +(defvar my-profiler-enabled nil + "Switch for enabling startup profiling. Set to `t' in '~/.emacs-pre'.") + (defvar my-lisp-usr-home-dir (expand-file-name "~/usr/share/emacs/site-lisp") "There is a place for additional lisp packages installed via 'DIST=~/usr make install'.") diff -r 3f69332472cb -r 0bab53c47567 .emacs-my --- a/.emacs-my Sat Jan 02 22:42:24 2021 +0200 +++ b/.emacs-my Sat Jan 02 23:11:23 2021 +0200 @@ -3873,7 +3873,7 @@ ; Lazy loading of buffer significantly reduces startup time! (setq desktop-restore-eager 1) (setq desktop-restore-frames nil) -(unless (and (boundp 'my-no-desktop-save-mode) my-no-desktop-save-mode) +(unless my-profiler-enabled (desktop-save-mode 1)) (setq desktop-globals-to-save diff -r 3f69332472cb -r 0bab53c47567 .emacs-post --- a/.emacs-post Sat Jan 02 22:42:24 2021 +0200 +++ b/.emacs-post Sat Jan 02 23:11:23 2021 +0200 @@ -22,9 +22,3 @@ ;; '(".*\\.\\([ch]\\|cpp\\|rc\\)" "c:/Program Files/Microsoft SDKs/Windows/v6.1/Include/TAGS") ;; )) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (message "profiler end") - -;; (profiler-report) -;; (profiler-stop) - diff -r 3f69332472cb -r 0bab53c47567 .emacs-pre --- a/.emacs-pre Sat Jan 02 22:42:24 2021 +0200 +++ b/.emacs-pre Sat Jan 02 23:11:23 2021 +0200 @@ -5,13 +5,12 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; (message "profiler start") -;; (profiler-start 'cpu) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; To disable activation desktop-save-mode as it ask for file overriding when -;; two Emacs are loaded making difficult automating like: time emacs-w32 --kill - -;; (setq my-no-desktop-save-mode t) +;; Set to `t' and run: +;; time emacs-w32 --kill +(setq my-profiler-enabled nil) +;; Override default only when actually profiling... Default is 1000000 ns. +(when my-profiler-enabled + (setq profiler-sampling-interval 100000)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; (message "libs pre-loading") diff -r 3f69332472cb -r 0bab53c47567 init.el --- a/init.el Sat Jan 02 22:42:24 2021 +0200 +++ b/init.el Sat Jan 02 23:11:23 2021 +0200 @@ -16,6 +16,9 @@ (load my-lisp-auth t) (load my-lisp-pre) +(when my-profiler-enabled + (profiler-start 'cpu)) + (my-lisp--load-usr-home) ;; (setq package-enable-at-startup t) @@ -26,3 +29,6 @@ (load my-lisp-dotemacs t) (load my-lisp-post t) +(when my-profiler-enabled + (profiler-report) + (profiler-stop))