In case this helps anyone, I've found this code makes profiling a lot
easier.  It automatically instruments the desired functions, runs the
code you want to test, removes the instrumentation, and presents the

#+BEGIN_SRC elisp
  (defmacro profile-org (times &rest body)
    `(let (output)
       (dolist (p '("org-"))  ; symbol prefixes to instrument
         (elp-instrument-package p))
       (dotimes (x ,times)
       (forward-line 20)
       (delete-region (point) (point-max))
       (setq output (buffer-substring-no-properties (point-min) (point-max)))

  ;; Used like this:
  (profile-org 10

Reply via email to