emacs-gdscript-mode
emacs-gdscript-mode copied to clipboard
Performance Issues
Not sure if this is a emacs-gdscript-mode problem or a Godot problem, so sorry in any case. Using with either Godot 3.x or 4.x specially on completion suggestions the editor stutters or even freezes for a few moments.
Ex: When typing "func _pro" and emacs suggests to code complete to "func _process(delta: float) -> void:" it occurs this stutter, freeze.
My best guess is due to the language server, but it's hard to guess based on the information you have provided. Can you try the profiler? It should give you more information regarding CPU/Memory usage.
I'm not sure how the profiler works and how to use it, being totally honest I didn't used emacs ( doom emacs to be precise ) in a few months. But wanted to ask this question to make sure if everyone had this problem.
Also note that on my attempts to make the experience a little better i tried using (setq company-idle-delay 0.3) on my config.el file
My best guess of how to do it, profiler-start, then I tried writting some funcs and then profiler-stop, then status.
But this had the sluggish experience, even without the company-idle-delay setting.
But even after all I tried when I was using emacs, and right now when I tried to profile it. Emacs(Doom Emacs) just feels a bit sluggish for gdscript.
Hello, @zMenta .
I think this is due to LSP. I used eglot to enable the following configuration, which would be slightly faster, but still not very fast.
The EGLOT's LOG shows that the response of jsonrpc is very slow, which may be your performance issue.
Thanks for the reply @xiliuya.
I think probably is a LSP server performance issue like you said. It's a shame really.
Like I mentioned before setting a delay it helped me not to have stutters, but it's counter productive since the completion feels slower that way.
I'm using vertico, eglot, and consult for completion, rather than company or corfu
(setq completion-in-region-function
(lambda (&rest args)
(apply (if vertico-mode
#'consult-completion-in-region
#'completion--in-region)
args)))
I trigger completions manually with C-M-i and when I do, it's often quite slow. When I try to complete on rotation, for some reason I get over 18,000 completion candidates. It takes 3-4 seconds to complete for me.
If I trigger complete-at-point when completing position, I get much more reasonable results at around 44;
It's still not as fast as I'd expect, there's maybe a 300-500 ms or so delay, but still, reasonable.
This is likely an upstream issue, no? While it's possible that the eglot client is requesting some funky stuff, it seems like it's the godot server providing this insane amount of completions?
It's not an ideal solution, but I've found that - at least in some cases - the freezing that happens when using Eglot can be "fixed" if you disable the events buffer by setting eglot-events-buffer-size to 0 somewhere in your config.
It's not an ideal solution, but I've found that - at least in some cases - the freezing that happens when using Eglot can be "fixed" if you disable the events buffer by setting
eglot-events-buffer-sizeto 0 somewhere in your config.
Thanks, this works so far.