unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: "João Távora" <joaotavora@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, 66669-done@debbugs.gnu.org
Subject: bug#66669: 30.0.50; [EGLOT] Emacs freezes when server sends a ton of progress notifications
Date: Sun, 22 Oct 2023 17:39:42 -0700	[thread overview]
Message-ID: <21123E04-37EA-40ED-8316-44EA45B6ECF2@gmail.com> (raw)
In-Reply-To: <CALDnm51uwro8YuKO6f3nuW=FDHz77gALTHjR6QZhqT1VVpsaFw@mail.gmail.com>



> On Oct 22, 2023, at 7:52 AM, João Távora <joaotavora@gmail.com> wrote:
> 
> On Sun, Oct 22, 2023 at 5:50 AM Eli Zaretskii <eliz@gnu.org> wrote:
>> 
>>> Cc: joaotavora@gmail.com
>>> From: Yuan Fu <casouri@gmail.com>
>>> Date: Sat, 21 Oct 2023 12:10:49 -0700
>>> 
>>> I use rust’s language server (rust-analyzer) with eglot. And whenever I turn eglot on for a project, Emacs freezes for a good 30 seconds, busy updating the eglot progress indicator, before I can do anything. I think the reason is that the rust language server sends a ton of progress notifications, which completely blocks Emacs before it’s done.
>>> 
>>> Setting eglot-report-progress to nil doesn’t help me, presumably because eglot still needs to process the notifications.
>> 
>> Can't this information be processed in chunks, not in one go?
> 
> Maybe, depending on what that means. I think it's important to
> get to the bottom of Yuan's "presumably" first, preferably by
> reproducing his problem.

Apologize for doubting eglot's ability to process messages :-) When trying to reproduce the problem, I eventually found out that it was project-files that was blocking. And project-files was blocking because I used a custom project method, which doesn’t properly ignore the build directory, which contains a ton of small files.

> * Have you profiled?  Have you tried setting eglot-events-buffer-size
>  to 0 (and restart Eglot) as suggested in the Eglot manual?  Many
>  performance problems are due to JSON objects being pretty printed in
>  the Eglot events buffer (BTW some users ask me to  turn it to 0 by
>  default, but the pros don't outweigh the cons, which in this case is
>  we would lose a valuable tool for newbie users with exotic servers to
>  send me their debug data easily)

I do have eglot-events-buffer-size set to 0. I observed the freeze, reset it to some large value, and saw a bunch of notifications, so I assumed that was the problem. That turns out to be very wrong :-)

Personally I also think the default value should be 0. (I wonder if disabling pp would improve it enough?) Eglot is really borderline non-usable when the value is non-0 and the language server is chatty (eg, rust, typescript). I certainly don’t want people to try out eglot, see the lag, and conclude that “Emacs is slow”.

Maybe providing a simple command like M-x eglot-enable-logging, and tell new users to turn this on and restart eglot, is good enough. But I’m not the one that dealt with eglot bug reports, maybe restarting eglot can’t reproduce the error in many cases?

Yuan




      reply	other threads:[~2023-10-23  0:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-21 19:10 bug#66669: 30.0.50; [EGLOT] Emacs freezes when server sends a ton of progress notifications Yuan Fu
2023-10-21 21:01 ` João Távora
2023-10-22  4:50 ` Eli Zaretskii
2023-10-22 14:52   ` João Távora
2023-10-23  0:39     ` Yuan Fu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=21123E04-37EA-40ED-8316-44EA45B6ECF2@gmail.com \
    --to=casouri@gmail.com \
    --cc=66669-done@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=joaotavora@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).