Subject: bug#77588: Catastrophic slowdown in eglot via `flymake-diag-region'

From: JD Smith <[email-masked]>
Date: Tue, 8 Apr 2025 12:24:00 -0400

> On Apr 8, 2025, at 11:42 AM, João Távora <[email-masked]> wrote:
> 
> The main difficulty seems to be finding a server which supports this mode. Clangd and basedpyright don't seem to. 

basedpyright actually does; it was added about a month ago via pyright:

https://github.com/microsoft/pyright/pull/10055￼
Implement support for pull diagnostics in Pyright by rchiodo · Pull Request #10055 · microsoft/pyright
github.com

>> - Can we be certain that `eglot--versioned-identifier' is always an integer?
> 
> 
> No. It can be nil. But what it's not nil, it's an integer as specified in the standard.

Then it might be worth switching the test to `(not (eq ...' from `(/= ...'.

>> I don't think the LSP server is to blame here.  Yes, it's sending large messages (too often) and getting behind, but it is dutifully providing the document version number. 
> 
> 
> I beg to differ. A server that is sending useless junk down the wire, however legal that junk is, is a server that should be fixed. As you well know, performance problems arise often from just parsing JSON into expensive Lisp structures.

My point is that the message's version info is an explicit acknowledgement that the information may be out of date by the time the client processes it.  I see no way around that (other than everything working quicker).  A fair critique is just how many push updates arrive.  I suspect if we raise this they'd point us to pull diagnostics anyway.  A nice feature of pull is it can respond "no changes" when there are none.