LSP-mode: By following instructions here: https://emacs-lsp.github.io/lsp-mode/page/performance/
For the rest: M-x profiler-start, Mx profiler-stop, then M-x profiler-report.
LSP-mode: By following instructions here: https://emacs-lsp.github.io/lsp-mode/page/performance/
For the rest: M-x profiler-start, Mx profiler-stop, then M-x profiler-report.