[X] You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain
Bug description
I've noticed that the lsp--fontlock-with-mode function seems to be slow when the built-in tree-sitter support (treesit) is automatically enabled. I suspect this is because the .so library is being loaded on every call. For instance, profiling shows it takes around 0.16 seconds to execute:
lsp--fontlock-with-mode 0.163621 s
lsp--fontlock-with-mode 0.162615 s
lsp--fontlock-with-mode 0.163193 s
lsp--fontlock-with-mode 0.163004 s
lsp--fontlock-with-mode 0.162281 s
But with treesit turned off, it only takes 0.002 seconds:
lsp--fontlock-with-mode 0.002005 s
lsp--fontlock-with-mode 0.002601 s
lsp--fontlock-with-mode 0.002055 s
lsp--fontlock-with-mode 0.002191 s
lsp--fontlock-with-mode 0.002485 s
Thank you for the bug report
lsp-mode
related packages.M-x lsp-start-plain
Bug description
I've noticed that the
lsp--fontlock-with-mode
function seems to be slow when the built-in tree-sitter support (treesit
) is automatically enabled. I suspect this is because the.so
library is being loaded on every call. For instance, profiling shows it takes around 0.16 seconds to execute:But with
treesit
turned off, it only takes 0.002 seconds:Steps to reproduce
Expected behavior
Fast hover as before with treesit.
Which Language Server did you use?
C++
OS
Linux
Error callstack
No response
Anything else?
My workaround: