Speeding up Emacs Lisp functions by disabling garbage collection

August 28, 2024 Emacs Lisp has nice built-in profiling tools but if you&rsquo;re just curious to see how long a function takes to run, you can call it from inside benchmark-run : ( benchmark-run ( my-slow-function ) ) This will output a list with three elements. The first is total runtime in seconds. The second element is the number of garbage collections required during execution, and finally the…