Achim Gratz <strom...@nexgo.de> writes: > Bastien writes: >>> org-macro-replace-all 2 222.371024 111.185512 >> >> This one looks suspicious: if the function does what it says, >> why does it run twice? If we can spare 111 secs here, that's >> already an improvement. I'll have a look at some point but >> feel free to beat me on this! > > That interpretation makes assumptions that may not be valid. I'm not > even sure that you can rely on the number of calls (elp may miss some at > least), but especially not that each call takes the same time. So it is > perfectly possible that the first call took 222 seconds and the second > one just 0.371024…
See (info "(elisp) Profiling") on a fairly recent Emacs. ,---- C-h n => Lisp Changes in Emacs 24.3 | ** New sampling-based Elisp profiler. | Try M-x profiler-start, do some work, and then call M-x profiler-report. | When finished, use M-x profiler-stop. The sampling rate can be based on | CPU time or memory allocations. `---- > > The top entry for profiler btw is "called-interactively". How helpful. > > Regards, > Achim. --