Closed daanturo closed 3 months ago
This one can be a nice perf optimization. I put a PR there, please test if it's work for you.
This one can be a nice perf optimization. I put a PR there, please test if it's work for you.
Thank you, that really works for me. It shaved the said benchmark time from 0.72s to 0.36s!
Searching the whole emacs-lsp organization, looks like https://github.com/emacs-lsp/lsp-dart/blob/13c981eece9a0cfd9eda3e20a304f0d82d7f450c/lsp-dart.el#L171 also needs updating.
Currently, loading
lsp-mode
whenyasnippet-snippets
is installed delays startup significantly.https://github.com/emacs-lsp/lsp-mode/blob/0038e09912f9715af52eeeff92f61e7598c8eb5a/lsp-mode.el#L59
Code to reproduce from vanilla Emacs:
Elapsed time: 0.426193s
Profiler result:
yasnippet-snippets-initialize
usually takes around 70~75% oflsp-mode
's loading time, while it doesn't see usage through LSP most of the time. Uninstalling the yasnippet* packages make loadinglsp-mode
noticeably faster.Grepping
lsp-mode
's code base, I only seeyasnippet
's usage atlsp-mode.el/lsp--expand-snippet
, andlsp-vscode-snippets.el
. Maybe we can makelsp--expand-snippet
only requireyasnippet
when needed? The(featurep 'yasnippet)
calls can be replaced by(fboundp 'yas-minor-mode)
.