Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I profile my emacs configuration?

My emacs configuration takes a very long time to load. How can I easily find the offending parts and optimize them?

like image 829
Phob Avatar asked Apr 23 '11 04:04

Phob


People also ask

Where is emacs configuration file?

el , the default is the directory ~/. config/emacs . This can be overridden by setting XDG_CONFIG_HOME in your environment, its value replaces ~/. config in the name of the default XDG init file.

Where is my init El?

In Windows 7 put your init. el file in C:\Users\user-name\AppData\Roaming\. emacs.

How do I reload a .emacs file?

In order to reload a file, you can use the macro M-x revert-buffer (if you want you can bind it to a key), or use a more practice trick: use C-x C-v RET. This tell to find an alternate file and by default emacs suggests you the current file.


2 Answers

Very useful package: http://www.emacswiki.org/emacs/ProfileDotEmacs

Just skip loading your init file and let ProfileDotEmacs load/profile it for you:

emacs -Q -l profile-dotemacs.el -f profile-dotemacs
like image 177
Jürgen Hötzel Avatar answered Oct 17 '22 08:10

Jürgen Hötzel


Another solution is ESUP, the Emacs Start Up Profiler. It can profile your config file without leaving Emacs - it accomplishes this by starting a new Emacs as a child process, getting profile information from it.

like image 43
legoscia Avatar answered Oct 17 '22 07:10

legoscia