Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance Issues #128

Open
zMenta opened this issue May 9, 2023 · 7 comments
Open

Performance Issues #128

zMenta opened this issue May 9, 2023 · 7 comments

Comments

@zMenta
Copy link

zMenta commented May 9, 2023

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.

@jcs090218
Copy link
Collaborator

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.

@zMenta
Copy link
Author

zMenta commented May 12, 2023

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.
image

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.

@xiliuya
Copy link
Collaborator

xiliuya commented May 14, 2023

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.
2023-05-14-181557

The EGLOT's LOG shows that the response of jsonrpc is very slow, which may be your performance issue.

2023-05-14-182047

@zMenta
Copy link
Author

zMenta commented May 14, 2023

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.

@JosephFerano
Copy link

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.

image

If I trigger complete-at-point when completing position, I get much more reasonable results at around 44;

image

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?

@wanpst
Copy link

wanpst commented Sep 4, 2023

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.

@lokithus
Copy link

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.

Thanks, this works so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants