lsp-dart icon indicating copy to clipboard operation
lsp-dart copied to clipboard

significant performance loss with lsp-dart-flutter-widget-guides

Open reimager opened this issue 3 years ago • 5 comments

This is an FYI in case others run into this issue. My lsp-dart performance was pretty terrible.

I was testing by just going into a dart file and typing a comment and mashing buttons. Something like: // aoeuao eaosethaosenuthaosneuhtaosueh aoeuaoeusnthaosh

There is a noticeable lag for characters to appear, sometimes several seconds. I can hear my CPU fans spin up as emacs takes 100% CPU.

I tried every version of everything as the cpu profile kept sending me in odd directions. Currently running emacs29, with native compilation, with plists for LSP, with json native libraries, and all the other stuff to maximize LSP performance. Also tried emacs27 without native compilation. Also tried with/without other stuff that I thought might be related: lsp-ui, helm, projectile, themes, company, etc

I finally figure out that I just need to:

(setq lsp-dart-flutter-widget-guides nil)

and the problem completely disappears.

lsp-version: LSP :: lsp-mode 8.0.0, Emacs 29.0.50, gnu/linux

lsp-dart-version: [LSP Dart] 1.22.2 at 2022.09.06 @ Emacs 29.0.50 [Dart SDK] Dart SDK version: 2.18.0 (stable) (Unknown timestamp) on "linux_x64"

lsp-doctor: Checking for Native JSON support: OK Check emacs supports read-process-output-max': OK Check read-process-output-max' default has been changed from 4k: OK Byte compiled against Native JSON (recompile lsp-mode if failing when Native JSON available): OK `gc-cons-threshold' increased?: OK Using gccemacs with emacs lisp native compilation (https://akrl.sdf.org/gccemacs.html): OK

reimager avatar Sep 06 '22 20:09 reimager

Thanks, to be honest I thought we solved every performance issue on that feature as we had lots of performance in the past, I work on big flutter projects and didn't notice that, but if there is anything we could fix it'd be nice

ericdallo avatar Sep 07 '22 12:09 ericdallo

+1 , (setq lsp-dart-flutter-widget-guides nil) setting up this is helping, else flutter with emacs was stuck and very slow.

gnumonk avatar Sep 27 '22 15:09 gnumonk

So, is there any plan of performance optimisation for the lsp-dart-flutter-widget-guides feature?

ashwinp15 avatar Apr 18 '24 12:04 ashwinp15