Benchmark
The most straightforward options is the built-in benchmark
package.
Its usage is remarkably simple:
(benchmark 100 (form (to be evaluated)))
It’s autoloaded, so you don’t even need to require it.
Profiling
Benchmark is good at overall tests, but if you’re having performance problems it doesn’t tell you which functions are causing the problem. For that, you have the (also built-in) profiler.
- Start it with
M-x profiler-start
. - Do some time consuming operations.
- Get the report with
M-x profiler-report
.
You should be taken to a buffer with a navigatable tree of function calls.