dholm / benchmark-init-el Goto Github PK
View Code? Open in Web Editor NEWBenchmark your Emacs initialization
Benchmark your Emacs initialization
Hello,
Could you provide a release tarball, please?
Just add a tag, for example: 1.0. Then make a git push --tags
.
Thanks,
Oleg.
My emacs takes over 30 seconds to load. However, when I run benchmark-init, I only see a few processes and these do not take more than 1 second overall. What is happening?
Hey! Just wanted to leave a comment that this finally got me to track down the two big cost centers (during startup) for my Emacs setup -- solarized/color and flycheck. Thanks a bunch! Now I can use terminal Emacs for interactive git rebase without being constantly annoyed.
I use an Org-mode init file, so everything gets tangled into main.el
first. So when I run benchmark-init-el
, I get a single big entry:
~/log/config/org/main.el load 2358 5093
Is there a way to get more granular benchmarking here without replaying the generated main.el
file?
Trying to install this package using straight. If I just eval a use-package
call for it, e.g.
(use-package benchmark-init
:demand)
I get (wrong-number-of-arguments (3 . 4) 2)
. Here's the backtrace:
Debugger entered--Lisp error: (wrong-number-of-arguments (3 . 4) 2)
#f(compiled-function (obsolete-name current-name when &optional docstring) "Set OBSOLETE-NAME's function definition to CURRENT-NAME and mark it obsolete.\n\n(define-obsolete-function-alias \\='old-fun \\='new-fun \"28.1\" \"old-fun's doc.\")\n\nis equivalent to the following two lines of code:\n\n(defalias \\='old-fun \\='new-fun \"old-fun's doc.\")\n(make-obsolete \\='old-fun \\='new-fun \"28.1\")\n\nWHEN should be a string indicating when the function was first\nmade obsolete, for example a date or a release number.\n\nSee the docstrings of `defalias' and `make-obsolete' for more details." #<bytecode 0x155f9ad0b6db0ed6>)('benchmark-init/install 'benchmark-init/activate)
(define-obsolete-function-alias 'benchmark-init/install 'benchmark-init/activate)
eval-buffer(#<buffer *load*> nil "/Users/apc/.emacs.d/straight/build/benchmark-init/..." nil t) ; Reading at buffer position 6700
load-with-code-conversion("/Users/apc/.emacs.d/straight/build/benchmark-init/..." "/Users/apc/.emacs.d/straight/build/benchmark-init/..." nil t)
require(benchmark-init nil nil)
(progn (use-package-statistics-gather :use-package 'benchmark-init nil) (straight-use-package 'benchmark-init) (use-package-statistics-gather :init 'benchmark-init nil) (require 'benchmark-init nil nil) (use-package-statistics-gather :config 'benchmark-init nil) (use-package-statistics-gather :config 'benchmark-init t) (use-package-statistics-gather :init 'benchmark-init t) (use-package-statistics-gather :use-package 'benchmark-init t))
(progn (defvar bootstrap-version) (progn (use-package-statistics-gather :use-package 'benchmark-init nil) (straight-use-package 'benchmark-init) (use-package-statistics-gather :init 'benchmark-init nil) (require 'benchmark-init nil nil) (use-package-statistics-gather :config 'benchmark-init nil) (use-package-statistics-gather :config 'benchmark-init t) (use-package-statistics-gather :init 'benchmark-init t) (use-package-statistics-gather :use-package 'benchmark-init t)))
eval((progn (defvar bootstrap-version) (progn (use-package-statistics-gather :use-package 'benchmark-init nil) (straight-use-package 'benchmark-init) (use-package-statistics-gather :init 'benchmark-init nil) (require 'benchmark-init nil nil) (use-package-statistics-gather :config 'benchmark-init nil) (use-package-statistics-gather :config 'benchmark-init t) (use-package-statistics-gather :init 'benchmark-init t) (use-package-statistics-gather :use-package 'benchmark-init t))) t)
elisp--eval-last-sexp(nil)
eval-last-sexp(nil)
funcall-interactively(eval-last-sexp nil)
call-interactively(eval-last-sexp nil nil)
command-execute(eval-last-sexp)
I'm on Emacs 28.0.90.
In order to make everything work, I had to put
(let ((benchmark-init.el "/path/to/el-get/benchmark-init/benchmark-init-modes.el"))
(when (file-exists-p benchmark-init.el)
(load benchmark-init.el)))
in my .emacs instead of the lines described in the README file.
I'm trying to follow the instructions for setting up benchmark-init, but I can't tabulate the benchmark results.
Download
$ cd ~/Desktop/src/
$ git clone [email protected]:dholm/benchmark-init-el.git
Configuration
https://github.com/mcandre/dotfiles/blob/benchmark/.emacs
I relaunched Emacs. Twice.
Then I tried to run (benchmark-init/show-durations-tabulated)
, Emacs complains that it can't find this function. Tab completion shows several functions for M-: (benchmark-init/...
, but show-durations-tabulated
is not one of them.
System
$ specs emacs brew os
Specs:
specs 0.12
https://github.com/mcandre/specs#readme
emacs --version
GNU Emacs 24.4.1
Copyright (C) 2014 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
brew --version
0.9.5
system_profiler SPSoftwareDataType | grep 'System Version'
System Version: OS X 10.10.2 (14C109)
Hmm, does benchmark-init play well with use-package, especially delayed package loading?
I installed benchmark-init
thanks to ELPA and, AFAICS, it has been put in ~/.emacs.d/elpa/benchmark-init-20150905.238
:
$ ls -1 ~/.emacs.d/elpa/benchmark-init-20150905.238
benchmark-init-autoloads.el
benchmark-init.el
benchmark-init.elc
benchmark-init-modes.el
benchmark-init-modes.elc
benchmark-init-pkg.el
But, the Makefile
is missing. If I add it manually:
$ make
make: nothing to do for « all ».
but no benchmark-init-loaddefs.el
file produced.
This is just a comment on improving the suggested method of loading the code when installed via el-get or the package manager. Currently the README suggests
(let ((benchmark-init.el "/path/to/el-get/benchmark-init/benchmark-init.el"))
(when (file-exists-p benchmark-init.el)
(load benchmark-init.el)))
however the load
function has options to not report an error if the file exists. Also by default it will start by trying to add extensions .elc
and .el
to the file name. I suggest you shorten the code to
(let ((benchmark-init-el "/path/to/el-get/benchmark-init/benchmark-init.el")
(load benchmark-init-el 'no-error nil 'no-suffix))
or even to a single load
statement
(load "/path/to/el-get/benchmark-init/benchmark-init.el"
'no-error nil 'no-suffix)
The emacs internal data of initial time is logger than benchmark.I guess something cause it.
I have used the
;; time the loading of the .emacs ;; keep this on top of your .emacs (defvar *emacs-load-start* (current-time)) (defun anarcat/time-to-ms (time) (+ (* (+ (* (car time) (expt 2 16)) (car (cdr time))) 1000000) (car (cdr (cdr time))))) (defun anarcat/display-timing () (message ".emacs loaded in %fms" (/ (- (anarcat/time-to-ms (current-time)) (anarcat/time-to-ms *emacs-load-start*)) 1000000.0))) (add-hook 'after-init-hook 'anarcat/display-timing t)
which from http://www.emacswiki.org/emacs/OptimizingEmacsStartup
The result is very close to emacs-init-time and more precise.
Could benchmark-init be colser to emacs-init-time, and tell us what happend between the 1600ms-899ms?
Can I sort the items in benchmark-init/show-durations-tabulated
by total ms
rather than ms
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.