Giter Site home page Giter Site logo

esup's Introduction

ESUP - Emacs Start Up Profiler

MELPA MELPA Stable Build Status

Benchmark Emacs Startup time without ever leaving your Emacs.

Installation

Known to work with GNU Emacs 25.1 and later. Esup may work with older versions of Emacs, but this is NOT guaranteed. Bug reports for problems related to using Esup with older versions of Emacs will most like not be addressed.

The master of all the material is the Git repository at https://github.com/jschaf/esup .

NOTE: The master branch will always contain the latest unstable version. If you wish to check older versions or formal, tagged release, please switch to the relevant tag.

Using MELPA

Add MELPA or MELPA Stable to the list of repositories to access this mode. MELPA tracks this Git repository and updates relatively soon after each commit or formal release. For more detail on setting up see MELPA Getting Started.

For those who want only formal, tagged releases use MELPA Stable:

(require 'package)
(add-to-list 'package-archives
             '("melpa-stable" . "https://stable.melpa.org/packages/") t)

(package-initialize)

For those who want rolling releases as they happen use MELPA:

(require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)

After initializing packaging system you can install Esup using preferred way:

package-list-packages

Use M-x package-refresh-contents and M-x package-list-packages to get to the package listing and install esup from there.

Manual

You can install esup manually by adding following to your init file:

(unless (package-installed-p 'esup)
    (package-refresh-contents)
    (package-install 'esup))

Cask

Add following to your Cask file:

(source melpa)

(depends-on "esup")

use-package

Add following to your init file:

(use-package esup
  :ensure t
  ;; To use MELPA Stable use ":pin melpa-stable",
  :pin melpa)

El-Get

Esup is included in the El-Get repository. To install Esup using El-Get:

M-x el-get-install RET esup RET

Another way is to create a recipe file esup.rcp as follows:

(:name esup
 :website "https://github.com/jschaf/esup"
 :description "Emacs Start Up Profiler"
 :type github
 :pkgname "jschaf/esup")

and add it to a directory present in el-get-recipe-path. Then, use M-x el-get-install RET esup or add:

(el-get-bundle esup)

to your init file.

Manual Install

Download Esup and place the download directory on your load-path like so:

(add-to-list 'load-path "~/.emacs.d/path/to/esup")

And add either of the two following lines to your initialization file. The first only loads Esup when necessary, the 2nd always during startup of GNU Emacs.

(autoload 'esup "esup" "Emacs Start Up Profiler." nil)
;; OR
(require 'esup)

Usage

To start Esup, run M-x esup, and watch the magic happen.

Profile a custom file with esup

By default, Esup will profile user-init-file. To profile a custom file, call esup with a prefix argument. That is, C-u M-x esup.

Developing

Patches are always welcome. To submit a patch, use something like the following workflow.

  • Clone the project:
git clone https://github.com/jschaf/esup.git
cd esup
git checkout -b MY-NEW-FIX
  • Implement your fix

  • Ensure that all elisp code is lint-clean with Flycheck

  • Test your fix with Cask

  • Test your fixes with the Emacs Regression Test runner

make test
  • Create a pull request with the normal GitHub user interface

esup's People

Contributors

benley avatar casouri avatar darwinawardwinner avatar destroyhimmyrobots avatar doolio avatar jcs090218 avatar jschaf avatar k-37 avatar legoscia avatar purcell avatar raxod502 avatar sergeyklay avatar stsquad avatar syohex avatar zenspider avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

esup's Issues

Profile required features

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

Ignore file-local variables

My init.el contains a file-local variable that is considered unsafe by default. When running esup, I'm asked whether I want to apply it, leading to an incorrect total time. Maybe esup should set enable-local-variables to nil before loading the init file.

EIEIO constructor requires an object name

The commit 2186a5f breaks esup, resulting in the following error:

Debugger entered--Lisp error: (invalid-slot-name "#<esup-result :file>" "/home/jez/.dotfiles/emacs.d/init.el")
  signal(invalid-slot-name ("#<esup-result :file>" "/home/jez/.dotfiles/emacs.d/init.el"))
  #[(object slot-name operation &optional new-value) "\302\303\304�! D\"\207" [object slot-name signal invalid-slot-name eieio-object-name] 4 "Method invoked when an attempt to access a slot in OBJECT fails.\nSLOT-NAME is the name of the failed slot, OPERATION is the type of access\nthat was requested, and optional NEW-VALUE is the value that was desired\nto be set.\n\nThis method is called from `oref', `oset', and other functions which\ndirectly reference slots in EIEIO objects."]([object esup-result :file "" 0 0 "" 0 0 0 0 0] "/home/jez/.dotfiles/emacs.d/init.el" oset :expression-string)
  apply(#[(object slot-name operation &optional new-value) "\302\303\304�! D\"\207" [object slot-name signal invalid-slot-name eieio-object-name] 4 "Method invoked when an attempt to access a slot in OBJECT fails.\nSLOT-NAME is the name of the failed slot, OPERATION is the type of access\nthat was requested, and optional NEW-VALUE is the value that was desired\nto be set.\n\nThis method is called from `oref', `oset', and other functions which\ndirectly reference slots in EIEIO objects."] ([object esup-result :file "" 0 0 "" 0 0 0 0 0] "/home/jez/.dotfiles/emacs.d/init.el" oset :expression-string))
  slot-missing([object esup-result :file "" 0 0 "" 0 0 0 0 0] "/home/jez/.dotfiles/emacs.d/init.el" oset :expression-string)
  #[(obj slots) "\304\216�\305H  B�\n\2057�\306�\305H\n@\"\211�\204%�\307�\n@\310\nA@$\210\202-�\311��\nA@#\210)\nAA\211�\204\f�\312)\207" [obj eieio--scoped-class-stack slots rn ((byte-code "�\210�A�\301\207" [eieio--scoped-class-stack nil] 1)) 1 eieio-initarg-to-attribute slot-missing oset eieio-oset nil] 6 "Set slots of OBJ with SLOTS which is a list of name/value pairs.\nCalled from the constructor routine."]([object esup-result :file "" 0 0 "" 0 0 0 0 0] ("/home/jez/.dotfiles/emacs.d/init.el" :expression-string #("(setq dotfiles-dir (file-name-directory (or (buffer-file-name) load-file-name)))" 0 80 (fontified nil)) :start-point 228 :end-point 308 :line-number 7 :exec-time 1.7223e-05 :gc-number 0 :gc-time 0.0))
  apply(#[(obj slots) "\304\216�\305H  B�\n\2057�\306�\305H\n@\"\211�\204%�\307�\n@\310\nA@$\210\202-�\311��\nA@#\210)\nAA\211�\204\f�\312)\207" [obj eieio--scoped-class-stack slots rn ((byte-code "�\210�A�\301\207" [eieio--scoped-class-stack nil] 1)) 1 eieio-initarg-to-attribute slot-missing oset eieio-oset nil] 6 "Set slots of OBJ with SLOTS which is a list of name/value pairs.\nCalled from the constructor routine."] ([object esup-result :file "" 0 0 "" 0 0 0 0 0] ("/home/jez/.dotfiles/emacs.d/init.el" :expression-string #("(setq dotfiles-dir (file-name-directory (or (buffer-file-name) load-file-name)))" 0 80 (fontified nil)) :start-point 228 :end-point 308 :line-number 7 :exec-time 1.7223e-05 :gc-number 0 :gc-time 0.0)))
  shared-initialize([object esup-result :file "" 0 0 "" 0 0 0 0 0] ("/home/jez/.dotfiles/emacs.d/init.el" :expression-string #("(setq dotfiles-dir (file-name-directory (or (buffer-file-name) load-file-name)))" 0 80 (fontified nil)) :start-point 228 :end-point 308 :line-number 7 :exec-time 1.7223e-05 :gc-number 0 :gc-time 0.0))
  #[(this &optional slots) "�\306H\307N\211�\310H� \311H�\n\203/�\312�@!\211��@=\204%�\313�\n@\f#\210)\nA��A�\202��+\314�
\"\207" [this this-class slot defaults dflt slots 1 eieio-class-definition 5 6 eieio-default-eval-maybe eieio-oset shared-initialize] 5 "Construct the new object THIS based on SLOTS.\nSLOTS is a tagged list where odd numbered elements are tags, and\neven numbered elements are the values to store in the tagged slot.\nIf you overload the `initialize-instance', there you will need to\ncall `shared-initialize' yourself, or you can call `call-next-method'\nto have this constructor called automatically.  If these steps are\nnot taken, then new objects of your class will not have their values\ndynamically set from SLOTS."]([object esup-result :file "" 0 0 "" 0 0 0 0 0] ("/home/jez/.dotfiles/emacs.d/init.el" :expression-string #("(setq dotfiles-dir (file-name-directory (or (buffer-file-name) load-file-name)))" 0 80 (fontified nil)) :start-point 228 :end-point 308 :line-number 7 :exec-time 1.7223e-05 :gc-number 0 :gc-time 0.0))
  apply(#[(this &optional slots) "�\306H\307N\211�\310H� \311H�\n\203/�\312�@!\211��@=\204%�\313�\n@\f#\210)\nA��A�\202��+\314�
\"\207" [this this-class slot defaults dflt slots 1 eieio-class-definition 5 6 eieio-default-eval-maybe eieio-oset shared-initialize] 5 "Construct the new object THIS based on SLOTS.\nSLOTS is a tagged list where odd numbered elements are tags, and\neven numbered elements are the values to store in the tagged slot.\nIf you overload the `initialize-instance', there you will need to\ncall `shared-initialize' yourself, or you can call `call-next-method'\nto have this constructor called automatically.  If these steps are\nnot taken, then new objects of your class will not have their values\ndynamically set from SLOTS."] ([object esup-result :file "" 0 0 "" 0 0 0 0 0] ("/home/jez/.dotfiles/emacs.d/init.el" :expression-string #("(setq dotfiles-dir (file-name-directory (or (buffer-file-name) load-file-name)))" 0 80 (fontified nil)) :start-point 228 :end-point 308 :line-number 7 :exec-time 1.7223e-05 :gc-number 0 :gc-time 0.0)))
  initialize-instance([object esup-result :file "" 0 0 "" 0 0 0 0 0] ("/home/jez/.dotfiles/emacs.d/init.el" :expression-string #("(setq dotfiles-dir (file-name-directory (or (buffer-file-name) load-file-name)))" 0 80 (fontified nil)) :start-point 228 :end-point 308 :line-number 7 :exec-time 1.7223e-05 :gc-number 0 :gc-time 0.0))
  eieio-default-superclass(esup-result :file "/home/jez/.dotfiles/emacs.d/init.el" :expression-string #("(setq dotfiles-dir (file-name-directory (or (buffer-file-name) load-file-name)))" 0 80 (fontified nil)) :start-point 228 :end-point 308 :line-number 7 :exec-time 1.7223e-05 :gc-number 0 :gc-time 0.0)
  apply(eieio-default-superclass (esup-result :file "/home/jez/.dotfiles/emacs.d/init.el" :expression-string #("(setq dotfiles-dir (file-name-directory (or (buffer-file-name) load-file-name)))" 0 80 (fontified nil)) :start-point 228 :end-point 308 :line-number 7 :exec-time 1.7223e-05 :gc-number 0 :gc-time 0.0))
  eieio-generic-call(constructor (esup-result :file "/home/jez/.dotfiles/emacs.d/init.el" :expression-string #("(setq dotfiles-dir (file-name-directory (or (buffer-file-name) load-file-name)))" 0 80 (fontified nil)) :start-point 228 :end-point 308 :line-number 7 :exec-time 1.7223e-05 :gc-number 0 :gc-time 0.0))
  constructor(esup-result :file "/home/jez/.dotfiles/emacs.d/init.el" :expression-string #("(setq dotfiles-dir (file-name-directory (or (buffer-file-name) load-file-name)))" 0 80 (fontified nil)) :start-point 228 :end-point 308 :line-number 7 :exec-time 1.7223e-05 :gc-number 0 :gc-time 0.0)
  apply(constructor esup-result :file ("/home/jez/.dotfiles/emacs.d/init.el" :expression-string #("(setq dotfiles-dir (file-name-directory (or (buffer-file-name) load-file-name)))" 0 80 (fontified nil)) :start-point 228 :end-point 308 :line-number 7 :exec-time 1.7223e-05 :gc-number 0 :gc-time 0.0))
  esup-result(:file "/home/jez/.dotfiles/emacs.d/init.el" :expression-string #("(setq dotfiles-dir (file-name-directory (or (buffer-file-name) load-file-name)))" 0 80 (fontified nil)) :start-point 228 :end-point 308 :line-number 7 :exec-time 1.7223e-05 :gc-number 0 :gc-time 0.0)
  esup-child-profile-sexp(228 308 0)
  esup-child-profile-buffer(#<buffer init.el> 0)
  esup-child-profile-file("/home/jez/.emacs.d/init.el" 0)
  esup-child-run("/home/jez/.emacs.d/init.el" "57397")
  eval((esup-child-run "/home/jez/.emacs.d/init.el" "57397"))
  command-line-1(("-L" "/home/jez/.dotfiles/emacs.d/el-get/esup/" "-l" "esup-child" "--eval=(esup-child-run \"/home/jez/.emacs.d/init.el\" \"57397\")"))
  command-line()
  normal-top-level()

It seems the object-name argument for an EIEIO constructor is mandatory.

By the way, if I revert this commit, then the fix for #23 works perfectly — thanks 😄

Handle non-existent files

I have a couple of places in my init where I use the optional second argument of load to ensure no error gets raised if the file doesn't exist. So I have a line:

(load "el-get-local.el" t)

Where the t ensures that it will silently fail if el-get-local.el doesn't exist. Unfortunately, esup gives me the following error if the file isn't there:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  expand-file-name(nil)
  find-file-noselect(nil)
  esup-child-profile-file("/home/jez/.dotfiles/emacs.d/el-get-local.el" 1)
  esup-child-profile-sexp(445 503 0)
  esup-child-profile-buffer(#<buffer init.el> 0)
  esup-child-profile-file("/home/jez/.emacs.d/init.el" 0)
  esup-child-run("/home/jez/.emacs.d/init.el" "52507")
  eval((esup-child-run "/home/jez/.emacs.d/init.el" "52507"))
  command-line-1(("-L" "/home/jez/.dotfiles/emacs.d/el-get/esup/" "-l" "esup-child" "--eval=(esup-child-run \"/home/jez/.emacs.d/init.el\" \"52507\")"))
  command-line()
  normal-top-level()

My full configuration is available at https://github.com/jezcope/dotfiles/tree/master/emacs.d if it helps.

Edit: *esup-log* here https://gist.github.com/7a3015df9f948ba9ed3b

Esup gives an error: Args out of range: "", 1

When I call esup with M-x esup, then I see a new frame popping up,

and ends it directly. In the *messages* buffer, I see only the message

Args out of range "", 1

Bisecting my init.el didn't help (as in comment out big parts of my init.el). What would you suggest to do?

Error on Emacs 26.1

Hi,

Based on this blog post, I've been trying to optimize my Emacs startup time, and I wanted to give esup a try - it looks like a very interesting tool.

When I run esup, I get the following messages:

esup process started on port 53850
at 1
error in process sentinel: eieio-oref: Wrong type argument: (or eieio-object class), nil, obj
error in process sentinel: Wrong type argument: (or eieio-object class), nil, obj

In addition, I get three *esup- buffers, with the following contents:

*esup-log*: https://gist.github.com/zzamboni/16e989ea5173a1c47327bcb5fdb86411
*esup-child*: empty
*esup-results*: https://gist.github.com/zzamboni/146c03d4d4b3feff50b35ea2b13ff901

I am running Emacs 26.1-pre1 from Homebrew, the full output of (emacs-version) is GNU Emacs 26.1 (build 1, x86_64-apple-darwin17.4.0, NS appkit-1561.20 Version 10.13.3 (Build 17D102)) of 2018-04-22.

For reference, my current configuration file is here: https://github.com/zzamboni/dot-emacs/blob/20686af45a3b33629480713018ea88b1164b6b79/init.el

error in process sentinel: esup-read-result: Invalid read syntax: "#"

I start esup with [M-x esup] inside of Emacs, after a long running about 3
minutes, Emacs prompt about whether save desktop (desktop-save-mode). I selected
"no". Then Emacs terminated esup sub-process, then display the following error
in *Messages* buffer.

error in process sentinel: esup-read-result: Invalid read syntax: "#"
error in process sentinel: Invalid read syntax: "#"

esup fails to run on macOS High Sierra / Emacs 25.3

Hey there, thanks for this great plugin! I recently started having some problems running M-x esup

screen shot 2018-03-28 at 4 45 00 pm

The *Messages* buffer has this:

For information about GNU Emacs and the GNU system, type C-h C-a.
Error: (void-function vc-git-root)
esup-child-send-log: Process *esup-child-connection* not running

Any ideas (this probably worked about a 2-3 weeks ago)?

Error in Emacs 26.0.50 (built from source)

I get the following error in the latest version of emacs built from source:

error in process sentinel: esup-read-result: Invalid read syntax: "#"
error in process sentinel: Invalid read syntax: "#"

The *esup-results* buffer then looks odd, with a bunch of lines that start like:

(#s(#s(eieio--class esup-result "A record of benchmarked results."...
;;ESUP-RESULT-SEPARATOR;;   

Not really sure what the source of the error is or how to fix...

Process *esup-child* exited abnormally with code 1

When I run esup, I get this message written to the top of the buffer I currently have open:

Process *esup-child* exited abnormally with code 1

And at the bottom of the screen I see:

esup process started on port 58085

Emacs 26.1 + macos, suspicious profile

After running esup I get the following first line in profile:

Total User Startup Time: 0.321sec Total Number of GC Pauses: 0 Total GC Time: 0.000sec

However, Emacs clearly take longer to start up (about 2-3 seconds). Most of it after frame has been created.

Version info:
GNU Emacs 26.1 (build 1, x86_64-apple-darwin14.5.0, NS appkit-1348.17 Version 10.10.5 (Build 14F2511)) of 2018-05-28

and

esup 20180506.1639 installed the Emacs StartUp Profiler (ESUP)

Profiler child process fails to connect to the server on Windows

Esup starts the child, but the child fails to connect to the server process saying something like: "Unknown service port: "

I've looked into the problem and found out that the esup-child-run function gets the port arg as a string, while something within esup-child-init-stream expects a number. string-to-number helps here.

This happens on my Windows 7 machine, with Emacs 24.4.1. Do not have the Linux machine right now, cannot check if it helps there.

Doesn't work on macOS with emacs-plus 26.0.91

Recently I started using the development version of Emacs to get the vfork patch. Unfortunately esup stopped working for me with GNU Emacs 26.0.91 on macOS 10.13.4. Emacs is installed via brew install emacs-plus --devel.

When running esup I get:

Debugger entered--Lisp error: (wrong-type-argument (or eieio-object class) nil obj)
  signal(wrong-type-argument ((or eieio-object class) nil obj))
  eieio-oref(nil :expression-string)
  esup-fontify-results((#<esup-result esup-result> ... #<esup-result esup-result> nil))
  esup-display-results()
  esup-child-process-sentinel(#<process *esup-child*> "finished\n")

Please note that I truncated the output of esup-fontify-results (( )), indicated by ....

`with-slots` is problematic on Emacs 24.3

I'm stuck with Emacs 24.3 at work and recently tried using esup. It failed at the step of rendering the results, producing an error message saying that expression-string is undefined. The problem is in the function render which makes use of with-slots. Apparently on Emacs 24.3 the with-slots macro expands to use symbol-macrolet instead of cl-symbol-macrolet; but esup.el requires cl-lib and not cl. I found two ways to get it to work: 1) rewriting the function to avoid with-slots (i.e., replacing file with (oref obj :file)), 2) adding a (require 'cl).

With either of those changes it works just fine.

Support foldable tree view

I've found out the other day that Emacs' profiler.el actually uses foldable trees in its report view. If you move point to the item you're interested in and hit RET, it opens it up so that you can see the offending parts better.

It would be pretty awesome to have the same debugging support in esup, simply because that way one has no longer to replace top-level forms executing other top-level forms in the init just to find the problematic spots. The code for the UI could be borrowed from profiler.el, I'm not sure about the changes needed for the backend. What do you think?

Symlinked init file

My emacs dir is c:\Users\Simon\.emacs.d

Inside is my .init.el file, however, it is symlinked to the actual file which is stored in my dropbox directory: d:\dropbox\emacs\.init.el

When I run esup I expect it to use my .emacs.d directory, and not my dropbox directory. However, when esup starts it is downloading all of the packages again to my dropbox dir, and I think its due to the symlink

The location of my user init file is correct (Simon\.emacs.d).

Is there any way to get esup to use the .emacs.d directory without following the symlink and downloading everything again to the dropbox dir?

My config is here if it helps

[Bug] - No indentation in *esup* buffer.

Can you make so all the code in *esup* buffer the same in the configuration including the indentation?

Edit: I thought this is something that hasn't be implemented. Apparently, I was wrong so I assume this is the bug I encountered.

no-indent

As the image, there are no indentation in the buffer. Not quite sure what I did wrong?

Using esup without el-get

This looks really cool! I just installed it via package.el, and when I tried to run it, got this error: "Cannot open load file: ~/.emacs.d/el-get/esup/esup.el"

I suppose before running the new instance of Emacs, you could check for esup.el in various locations and then use that information instead of the hardcoded el-get location.

How to use?

Hi, i want use esup to check my emacs startup time . when i run esup i got this ..
image

by the way i split my config into some folders.

esup chokes on empty config files

esup gives end of file error, when load loads a file with only comments in it.

How to reproduce:

  1. create file foo.rc.el within load-path, with content:
;; nothing here, just a comment
  1. insert following line into your init.el:
(load "foo.rc" nil t)

“Symbolic link to Git-controlled source file; follow link? (yes or no) ”

When runing M-x esup, a new emacs instance opens a frame and prompts me “Symbolic link to Git-controlled source file; follow link? (yes or no) ”.

This is because ~/.emacs.d is a symbolic link to ~/configfiles/config/emacs/, which lives inside a Git repository.

Interestingly enough, this also happens when evaluating (esup "/home/michael/configfiles/config/emacs/init.el") in the *scratch* buffer, at which point I would have expected the prompt to no longer show as the ~/.emacs.d symlink should no longer be involved.

I found a workaround, but it’s quite a big hammer: placing (setq vc-follow-symlinks t) in /etc/emacs/site-start.el

Fails to run on Emacs 25.0.50.2

Debugger entered--Lisp error: (void-function vc-responsible-backend)
  vc-responsible-backend("/home/pythonnut/.emacs.d/init.el")
  vc-working-revision("/home/pythonnut/.emacs.d/init.el")
  vc-git-mode-line-string("/home/pythonnut/.emacs.d/init.el")
  apply(vc-git-mode-line-string "/home/pythonnut/.emacs.d/init.el")
  vc-call-backend(Git mode-line-string "/home/pythonnut/.emacs.d/init.el")
  vc-mode-line("/home/pythonnut/.emacs.d/init.el" Git)
  vc-find-file-hook()
  run-hooks(find-file-hook)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer init.el> "~/.emacs.d/init.el" nil nil "~/.emacs.d/init.el" (2500373 40))
  find-file-noselect("/home/pythonnut/.emacs.d/init.el")
  esup-child-profile-file("/home/pythonnut/.emacs.d/init.el" 0)
  esup-child-run("/home/pythonnut/.emacs.d/init.el" "41966")
  eval((esup-child-run "/home/pythonnut/.emacs.d/init.el" "41966"))
  command-line-1(("-L" "/home/pythonnut/.emacs.d/elpa/esup-20150222.1815/" "-l" "esup-child" "--eval=(esup-child-run \"/home/pythonnut/.emacs.d/init.el\" \"41966\")"))
  command-line()
  normal-top-level()

My init.el contains nothing.

My system is:

  • Arch Linux
  • Emacs 25.0.50.2

Byte compile warnings

Hello,

There are byte compile warnings I would like avoid to. I hope most of them are trivial. Please let me know if I can help you with this.

In esup-child-profile-string:
esup-child.el:363:16: Warning: Obsolete name arg "esup-result" to constructor
    esup-result

In esup-child-serialize-result:
esup-child.el:407:13: Warning: Unknown slot ‘:file’
esup-child.el:406:5: Warning: Unknown slot ‘:start-point’
esup-child.el:409:5: Warning: Unknown slot ‘:line-number’
esup-child.el:411:5: Warning: Unknown slot ‘:expression-string’
esup-child.el:407:47: Warning: Unknown slot ‘:end-point’
esup-child.el:408:47: Warning: Unknown slot ‘:exec-time’
esup-child.el:409:47: Warning: Unknown slot ‘:gc-number’
esup-child.el:410:47: Warning: Unknown slot ‘:gc-time’
Compiling ~/.local/share/emacs/elpa/28.0.50/esup-20200120.740/esup-pkg.el...
Compiling ~/.local/share/emacs/elpa/28.0.50/esup-20200120.740/esup.el...

In esup-total-exec-time:
esup.el:163:46: Warning: Unknown slot ‘:exec-time’

In esup-total-gc-number:
esup.el:169:46: Warning: Unknown slot ‘:gc-number’

In esup-total-gc-time:
esup.el:175:44: Warning: Unknown slot ‘:gc-time’

In esup-drop-insignificant-times:
esup.el:183:39: Warning: Unknown slot ‘:exec-time’
../../../../../../.emacs.d/site-lisp/devtools.el: ‘defmethod’ is an obsolete macro (as of 25.1); use ‘cl-defmethod’ instead.
../../../../../../.emacs.d/site-lisp/devtools.el: ‘defgeneric’ is an obsolete macro (as of 25.1); use ‘cl-defgeneric’ instead.

In esup-fontify-results:
esup.el:557:15: Warning: Unknown slot ‘:expression-string’

In esup-next-separator-end-point:
esup.el:579:35: Warning: reference to free variable
    ‘esup-child-result-separator’

Problem emulating load with eval

It seems commit 81f5f4d changed esup-child.el to use advice on the load function. The advised function then steps through the code one sexp at at time doing an eval. This causes problems with the files automatically generated by package-install, which all contain lines such as:

(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))

The #$ construct is handled by load, but generates an error with eval.

On a related note, since my esup only works when esup-child-max-depth is 0, how does one set this variable?

emacs-init-time != esup startup time?

I've been trying to speed things up with esup, but I'm having trouble understanding why it is giving me so different numbers from emacs-init-time:

(emacs-init-time) => .8 seconds

(esup) => .194 seconds

Maybe this just needs to be documented better. I suspect it has to do with emacs-init-time starting earlier than esup is able to?

package.el generates a runtime error

Hello. When running esup an error is generated:

ERROR: the child emacs had the following errors:
  ERROR(profile-sexp) at /Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/package.elc:15: (error Not enough arguments for format string)

Results will be incomplete due to errors.


Total User Startup Time: 0.000sec     Total Number of GC Pauses: 0     Total GC Time: 0.000sec

package.elc:16  0.000sec   50%
(defvar package--default-summary "No description available.")

init.el:3  0.000sec   50%
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)

My init.el begins as:

(require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)

I'm running a nightly version of Emacs: 26.0.50 from 6-11 from emacsforosx.com. I'll retest on 25.2.

Profiling spacemacs

Hi, how can I use esup to profile spacemacs' start time? Currently I got

ERROR: the child emacs had the following errors:
  ERROR(profile-sexp) at /home/amos/.emacs.d/init.el:22: (wrong-type-argument stringp nil)

Results will be incomplete due to errors.


Total User Startup Time: 0.000sec     Total Number of GC Pauses: 0     Total GC Time: 0.000sec

init.el:17  0.000sec   33%
(setq gc-cons-threshold 100000000)

init.el:19  0.000sec   33%
(defconst spacemacs-version          "0.200.9" "Spacemacs version.")

init.el:20  0.000sec   33%
(defconst spacemacs-emacs-min-version   "24.4" "Minimal version of Emacs.")

Invalid byte code error (cl--defalias) in emacs 24.5 and emacs 25.x

Hi,

I haven't tried M-x esup in earlier versions but in versions 24.5 (latest stable as of now) and the latest build from git master branch (25.x), I get this error:

Debugger entered--Lisp error: (error "Invalid byte code")
  cl--defalias(cl-values list "Return multiple values, Common Lisp style.\nThe arguments of `cl-values' are the values\nthat the containing function should return.\n\n(fn &rest VALUES)")
  byte-code("\300\301\302\303#\210\300\304\305\306#\207" [cl--defalias cl-values list "Return multiple values, Common Lisp style.\nThe arguments of `cl-values' are the values\nthat the containing function should return.\n\n(fn &rest VALUES)" cl-values-list identity "Return multiple values, Common Lisp style, taken from a list.\nLIST specifies the list of values\nthat the containing function should return.\n\n(fn LIST)"] 4)
  eval((byte-code "\300\301\302\303#\210\300\304\305\306#\207" [cl--defalias cl-values list "Return multiple values, Common Lisp style.\nThe arguments of `cl-values' are the values\nthat the containing function should return.\n\n(fn &rest VALUES)" cl-values-list identity "Return multiple values, Common Lisp style, taken from a list.\nLIST specifies the list of values\nthat the containing function should return.\n\n(fn LIST)"] 4))
  esup-child-profile-sexp(3554 3979 1)
  esup-child-profile-buffer(#<buffer cl-lib.elc> 1)
  esup-child-profile-file("cl-lib" 1)
  esup-child-profile-sexp(6215 6232 0)
  esup-child-profile-buffer(#<buffer init.el> 0)
  esup-child-profile-file("/home/kmodi/.emacs.d/init.el" 0)
  esup-child-run("/home/kmodi/.emacs.d/init.el" "53398")
  eval((esup-child-run "/home/kmodi/.emacs.d/init.el" "53398"))
  command-line-1(("-L" "/home/kmodi/.emacs.d-master/elpa_25_0/esup-20150519.1701/" "-l" "esup-child" "--eval=(esup-child-run \"/home/kmodi/.emacs.d/init.el\" \"53398\")"))
  command-line()
  normal-top-level()

Support "repeat N times and show the average"

Startup times can be unstable. It would be nice to be able to repeat the startup several times and take the average to get a more stable estimate (and maybe also the standard deviation).

esup only profiles first few forms in my init-file

My Emacs setup is available here, including my init.el. Startup takes just over one second for me, but esup reports 0.002 seconds. Looking at the output, I can see that only the forms near the beginning of my init.el actually appear (and, presumably, are profiled).

I'm not sure how I can narrow this problem down further. The same thing happens when I run C-u M-x esup RET C-a C-k ~/.emacs.d/init.el RET from emacs -Q.

Here is the output of M-x esup on a fresh installation of my setup on an OS X El Capitan virtual machine (with esup added to the default package list):

Total User Startup Time: 0.002sec     Total Number of GC Pauses: 0     Total GC Time: 0.000sec

init.el:118  0.002sec   96%
(radian-load-user-config "init.before.local.el")

cl-lib.elc:16  0.000sec   0%
(require 'macroexp)

init.el:86  0.000sec   0%
(defun radian-add-package (package)
"Adds the provided package from `radian-packages', if it is not
already present. For use in init.before.local.el. Note that this
function will not install the provided package. To do that, call
`radian-update-packages'."
;; Passing `t' to `add-to-list' makes the addition happen at the end
;; of the list.
(add-to-list 'radian-packages package t))

init.el:95  0.000sec   0%
(defun radian-remove-package (package)
"Removes the provided package from `radian-packages', if it is
present. For use in init.before.local.el. Note that this function
will not uninstall the package; it will only prevent the package
from being installed automatically. For now, you have to
uninstall packages manually, by deleting their folders in
~/.emacs.d/elpa."
(setq radian-packages (delete package radian-packages)))

init.el:108  0.000sec   0%
(defun radian-load-user-config (filename)
"If a file by the specified name exists in the ~/.emacs.d directory,
loads it. Otherwise, fails silently."
(let ((file (concat user-emacs-directory filename)))
(when (file-exists-p file)
(load-file file))))

init.el:134  0.000sec   0%
(defun display-startup-echo-area-message ())

cl-lib.elc:19  0.000sec   0%
(byte-code "\300\301\302\303#\210\304\211\203(�\211@\301�N\203!�\302�N\204!�\305\302�\301�N#\210�A\266\202\202��\210\306\301\302\307#\207" [defvaralias custom-print-functions cl-custom-print-functions nil (saved-value saved-variable-comment) put make-obsolete-variable "24.3"] 7)

cl-lib.elc:34  0.000sec   0%
(defalias 'cl-incf '(macro . #[513 #@106 ("��9\203��0\300��\203��0\301��E\202��0\302�DE\207\303\301��\206�_�0\304F\207" . [setq + 1+ cl-callf 1])�(#$ . 1540) nil 7 (#$ . 1315)]))

cl-lib.elc:35  0.000sec   0%
(put 'cl-incf 'edebug-form-spec '(place &optional form))

cl-lib.elc:50  0.000sec   0%
(defalias 'cl-pushnew '(macro . #[642 #@284 ("��9\203I�0\211\204>�0�\300��!\203��0\211\202��0\301\302!\303\304���E\305��D\306��\307���\nEEF���=\2036�0\211\202=�0\310��DC�\"\207\306�\311���BBBE\207\312\311���BBBB\207" . [macroexp-const-p make-symbol "var" if memql with-no-warnings setq cons macroexp-let* cl-adjoin cl-callf2])�(#$ . 2455) nil 13 (#$ . 2152)]))

cl-lib.elc:51  0.000sec   0%
(put 'cl-pushnew 'edebug-form-spec '(form place &rest &or [[&or ":test" ":test-not" ":key"] function-form] [keywordp form]))

cl-lib.elc:52  0.000sec   0%
(defalias 'cl--set-elt #[771 #@45 ("�<\203��0���\233��\240\207���I\207" . [])�(#$ . 2931) nil 6 "\n\n(fn SEQ N VAL)"])

cl-lib.elc:54  0.000sec   0%
(defalias 'cl--set-substring #[1028 #@133 ("��\203��0��\300W\203��0���G\\\262�\202��0�G\262��\300W\203#�0��G\\\262��\300V\205-�0�\300�O�����GW\205:�0��\301OQ\207" . [0 nil])�(#$ . 3191) nil 9 "\n\n(fn STR START END VAL)"])

init.el:45  0.000sec   0%
(setq radian-customize-tweak-colors t)

init.el:64  0.000sec   0%
(defvar radian-packages nil "The packages required by Radian.")

init.el:65  0.000sec   0%
(setq radian-packages
'(
ace-jump-mode ; quickly jump to words, characters, or lines onscreen
aggressive-indent ; keep code correctly indented at all times
cider ; Clojure REPL integration
clojure-mode ; Clojure indentation and syntax highlighting
company ; autocompletion with pop-up menu
company-statistics ; sort Company completions by usage
geiser ; support for Racket
helm ; better interface for selecting files, buffers, or commands
helm-projectile ; use Helm for Projectile
helm-smex ; sort M-x suggestions by usage
markdown-toc ; generate tables of contents for Markdown files
paredit ; keep parentheses correctly balanced at all times
projectile ; quickly jump to files organized by project
undo-tree ; more intuitive and powerful undo/redo
))

cl-lib.elc:17  0.000sec   0%
(defvar cl--optimize-speed 1)

cl-lib.elc:18  0.000sec   0%
(defvar cl--optimize-safety 1)

cl-lib.elc:28  0.000sec   0%
(defvar cl-custom-print-functions nil (#$ . 814))

cl-lib.elc:41  0.000sec   0%
(defalias 'cl-decf '(macro . #[513 #@106 ("��9\203��0\300��\203��0\301��E\202��0\302�DE\207\303\301��\206�_�0\304F\207" . [setq - 1- cl-callf 1])�(#$ . 1966) nil 7 (#$ . 1741)]))

cl-lib.elc:42  0.000sec   0%
(put 'cl-decf 'edebug-form-spec 'cl-incf)

cl-lib.elc:55  0.000sec   0%
(byte-code "\300\301\302\"\210\300\303\304\"\207" [defalias cl--block-wrapper identity cl--block-throw throw] 3)

cl-lib.elc:56  0.000sec   0%
(defalias 'cl--defalias #[770 #@95 ("\300���#\210\301�\302\303#\207" . [defalias put byte-optimizer byte-compile-inline-expand])�(#$ . 3520) nil 7 "\n\n(fn CL-F EL-F &optional DOC)"])

cl-lib.elc:64  0.000sec   0%
(defalias 'cl-multiple-value-list #[257 #@15 ("\207" . [])�(#$ . 4386) nil 2 (#$ . 4101)])

cl-lib.elc:53  0.000sec   0%
(defalias 'cl--set-buffer-substring #[771 #@42 ("\212��|\210�b\210\211c\210)\207" . [])�(#$ . 3063) nil 5 "\n\n(fn START END VAL)"])

Process *esup-child* exited abnormally with code 1

Steps to reproduce:

  1. run emacs in terminal (emacs -nw)
  2. run esup (M-x esup)
  3. in minibuffer, esup started on port 35402.
  4. in the current buffer Process *esup-child* exited abnormally with code 1 is displayed.
  5. GNU Emacs 24.5.1 (i686-pc-linux-gnu) of 2015-12-11 built with--without-x. Does this package need GUI version of emacs to work properly?

esup stops profiling after string

Esup stops profiling after parsing a formatted string here is my code

(defun display-startup-echo-area-message ()
  "Emacs startup time"
      (message "Load time is %s" (emacs-init-time)))

This is the error message:

LOG: profiling sexp ~/.emacs.d/init.el:25 (defun display-startup-echo-ar
LOG: ERROR(profile-sexp) at ~/.emacs.d/init.el:25: (error Not enough arguments for format string)
name: esup-server <127.0.0.1:22557>, sentinel: proc: esup-server <127.0.0.1:22557>, event connection broken by remote peer

The same thing happens with this code:
(setq frame-title-format "%@%b%*")

I'm using Emacs 25.2.1 on Windows

There is a empty line at the beginning when there is no error

When M-x esup is finished, there is no error detected. In buffer *esup*, the first line is empty and point is at the beginning, n (esup-next-result) doesn't work here and says

funcall-interactively: Beginning of buffer

The following fix the issue by not insert the empty line when there is no error.

diff -u --label /Users/xcy/.emacs.d/elpa-27.0.50/esup-20170923.1328/esup.el --label \#\<buffer\ esup.el\> /Users/xcy/.emacs.d/elpa-27.0.50/esup-20170923.1328/esup.el /var/folders/7f/s191h4q97p90374yw15ssrs00000gn/T/buffer-content-S2prZQ
--- /Users/xcy/.emacs.d/elpa-27.0.50/esup-20170923.1328/esup.el
+++ #<buffer esup.el>
@@ -462,7 +462,8 @@
     (with-current-buffer (esup-buffer)
       (erase-buffer)
       (esup-update-percentages results)
-      (insert (esup-render-errors esup-errors) result-break)
+      (when esup-errors
+        (insert (esup-render-errors esup-errors) result-break))
       (insert (esup-render-summary results) result-break)
       (cl-loop for result in results
                do (insert (render result) result-break))

Diff finished.  Sat Dec 30 14:45:58 2017

Esup breaks on 25.3 flymake

When running the profiler, Esup breaks on trying to load what looks like Flymake or the Zenburn theme. It still consumes resources, but does nothing. What logs do you need to see?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.