Emacs Native Profiler

I'm working on an Emacs Native Profiler branch that enables you to profile emacs lisp programs without overheads.

Features

This profiler will not involve high overheads[1] that is appeared in elp package, because this profiler adopts CPU sampling method by using setitimer function internally but not tracing method.

Source Code

There is a bazaar branch of GNU Emacs 23.1:

http://cx4a.org/repo/emacs.bzr/native-profiler/

You can checkout with bzr command like:

$ bzr branch http://cx4a.org/repo/emacs.bzr/native-profiler/

And you can compile it as usual.

How To Use

First of all, you need to load profiler module.

(require 'profiler)

I know it should be included in emacs when dumping.

There are several commands.

profiler-start
Start profiling
profiler-stop
Stop profiling
profiler-clear
Clear current statistics
profiler-results
Display profiling results

Generally you will use profiler as follow:

  1. M-x profiler-start
  2. Do something you want to profiling
  3. M-x profiler-stop (Optional)
  4. M-x profiler-results

Status

Currently, only Linux is supported. I really want to support other systems too.


  1. 3% to 5% maybe