Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GNU EMACS PERFORMANCE PROFILING

14 views
Skip to first unread message

joseph....@dowjones.com

unread,
Jul 1, 2015, 11:00:35 AM7/1/15
to
Hello all,

Is there some kind of performance profiler in Gnu Emacs?

I have some custom lisp code that I invoke for basic buffer operations such as switching buffers. I experience a delay with Gnu Emacs 24. This delay does not happen in Gnu Emacs 21..

So I'm trying to find out where emacs 24 is spending it's time internally vs emacs 21, and to see if I can improve it..

Is there some kind of profiler that records perhaps the milliseconds where emacs is spending in each function (my functions as well as emacs's internal functions) ?

Thanks In Advanced

Joe

Óscar Fuentes

unread,
Jul 1, 2015, 11:16:24 AM7/1/15
to help-gn...@gnu.org
joseph....@dowjones.com writes:

[snip]

> Is there some kind of profiler that records perhaps the milliseconds
> where emacs is spending in each function (my functions as well as
> emacs's internal functions) ?

See the "Profiling" node in the Elisp manual.


Emanuel Berg

unread,
Jul 1, 2015, 1:35:19 PM7/1/15
to help-gn...@gnu.org
joseph....@dowjones.com writes:

> Is there some kind of performance profiler in
> Gnu Emacs? ...
>
> Thanks In Advanced

Ha! Advanced stuff is indeed what is required.

Use this. It isn't mine - see the URL for credits.

(defmacro measure-time (&rest body)
"Measure and return the running time of the code block.
Not mine: http://nullprogram.com/blog/2009/05/28/"
(declare (indent defun))
(let ((start (make-symbol "start")))
`(let ((,start (float-time)))
,@body
(- (float-time) ,start))))

--
underground experts united
http://user.it.uu.se/~embe8573


0 new messages