jschaf / esup

ESUP - Emacs Start Up Profiler
401 stars 21 forks source link

Profile required features #36

Closed dschrempf closed 6 years ago

dschrempf commented 8 years ago

Hello,

first and foremost, thanks for this great tool!

Is it also possible to profile features that are loaded during initialization? E.g., I have configured my .emacs such that it requires different files upon startup and when I run esup I only get the total load time, e.g.,

init.el:52  0.971sec   23%
(require 'init-cedet)

This is already very helpful but I would appreciate if I could dig one level deeper!

Thanks, Dominik

jschaf commented 8 years ago

Hi, thanks for reporting. Huh, esup should step into 1 level of require by default. The amount it steps is controlled by esup-child-profile-require-level in esup-child.el. There's not a way to change it other than hard-coding. I should probably add an extension point in esup.el.

Could you try this and let me know what happens:

  1. Change (defvar esup-child-profile-require-level 1 "<snip doc-string>") to default to 2 in esup-child.el
  2. Save the file and byte-compile it.
  3. Run esup and let me know if it steps deeper
dschrempf commented 8 years ago

Hello,

thanks for the answer. You are right, it actually steps two level deeper (my .emacs loads a init.el which loads the modules; complicated). If I change the esup-child-profile-require to 2 and try to run esup I get an error:

Debugger entered--Lisp error: (wrong-type-argument stringp nil) file-name-directory(nil) (expand-file-name "tex-site.el" (file-name-directory load-file-name)) (autoload (quote TeX-load-hack) (expand-file-name "tex-site.el" (file-name-directory load-file-name))) eval((autoload (quote TeX-load-hack) (expand-file-name "tex-site.el" (file-name-directory load-file-name)))) esup-child-profile-string(#("(autoload 'TeX-load-hack\n(expand-file-name \"tex-site.el\" (file-name-directory load-file-name)))" 0 25 (fontified nil) 25 95 (fontified nil)) "/usr/share/emacs/site-lisp/auctex.el" 7 210 307) esup-child-profile-sexp(210 307 3) esup-child-profile-buffer(# 3) esup-child-profile-file("auctex.el" 3) esup-child-profile-sexp(333 359 2) esup-child-profile-buffer(# 2) esup-child-profile-file("init-auctex-mode" 2) esup-child-profile-sexp(858 885 1) esup-child-profile-buffer(# 1) esup-child-profile-file("init" 1) esup-child-profile-sexp(389 404 0) esup-child-profile-buffer(#<buffer .emacs> 0) esup-child-profile-file("/home/dominik/.emacs" 0) esup-child-run("/home/dominik/.emacs" "44328") eval((esup-child-run "/home/dominik/.emacs" "44328")) command-line-1(("-L" "/home/dominik/.emacs.d/elpa/esup-20151227.950/" "-l" "esup-child" "--eval=(esup-child-run \"/home/dominik/.emacs\" \"44328\")")) command-line() normal-top-level()

auctex.el just contains: ;;; auctex.el ;; ;; This can be used for starting up AUCTeX. The following somewhat ;; strange trick causes tex-site.el to be loaded in a way that can be ;; safely undone using (unload-feature 'tex-site). ;; (autoload 'TeX-load-hack (expand-file-name "tex-site.el" (file-name-directory load-file-name))) (TeX-load-hack)

It is not a problem if this is complicated to solve (or maybe this is a problem of auctex), I can also change the structure of my init files.

Thanks, Dominik

On Thu, Feb 11 2016, Joe Schafer wrote:

Hi, thanks for reporting. Huh, esup should step into 1 level of require by default. The amount it steps is controlled by esup-child-profile-require-level in esup-child.el. There's not a way to change it other than hard-coding. I should probably add an extension point in esup.el.

Could you try this and let me know what happens:

  1. Change (defvar esup-child-profile-require-level 1 "<snip doc-string>") to default to 2 in esup-child.el
  2. Save the file and byte-compile it.
  3. Run esup and let me know if it steps deeper

Reply to this email directly or view it on GitHub.*

jschaf commented 6 years ago

This should be fixed by 9d13e8c5bd4c3ed80177e8938afc4334d9dfd06e. Please re-open if that's not the case.