Description
Apart from some commands taking a lot of time/memory to run, there is another common problem of Emacs being slower when running for a long time. The same command running on fresh Emacs and Emacs running for several days may take several times longer to finish.
The slowdown can be caused by many reasons, like overall memory leakage or just changing the environment (e.g. changing buffer text or buffer-local variables). Tracking down this kind of problems is extremely difficult without a right toolset. There were some attempts to make a toolset in the past [1,2], but they are often troublesome to use.
If would be useful to track how cpu time/memory consumption changes through Emacs session for various commands.
[1] https://www.emacswiki.org/emacs/EmacsMemoryDebugging
[2] http://notes.secretsauce.net/notes/2015/10/05_memory-leak-debugging-tools.html