Thanks to aspiers this is now a real project with a repo!
I posted this without any intention to maintain or extend it because I don't really use Emacs much, but @aspiers offered to turn it into a real repo people can contribute to, so check out the latest version there:
Performance Tracing For Emacs
How To Use It
- Either M-: (require 'etrace) or add (require 'etrace) to your Emacs config, or enable the micro-feature for it if you use micro-features from the non-Spacemacs Emacs config. (Optional) Run M-x customize-variable etrace-output-file to change where the trace will be written, it defaults to ~/etrace.json
- Run M-x elp-instrument-package and type in a function prefix to instrument all the functions with that prefix. It uses a completion box so note that by default it'll complete to whatever's selected in there, if you want to complete to a prefix with no corresponding function you can press the up arrow until the text you typed is selected rather than any completion. There's also M-x elp-instrument-function for individual functions.
- Run M-x etrace-clear
- Do the thing you want a trace of
- Run M-x etrace-write to write out the trace file.
- Go to chrome://tracing in Chrome and click the load button and open the trace file. Use alt+scroll to zoom. Alternatively use https://ui.perfetto.dev/#!/ which is also good but in different ways, for example it can show you the total time and percentage of time taken by different functions in a selection range.
- Make some changes and then repeat from step 4.
- Run M-x elp-restore-all to un-instrument any instrumented functions
Here it is: https://github.com/aspiers/etrace
@trishume Please could you confirm you're OK with the
LICENSEfile I added?