Subject: bug#73718: 31.0.50; Severe performance issue with Tramp and project-mode-line-format

From: Michael Albinus <[email-masked]>
Date: Fri, 11 Oct 2024 13:45:49 +0200

Dmitry Gutov <[email-masked]> writes:

Hi Dmitry,

>>> I wonder if we'll need to disable project-mode-line in remote files
>>> altogether, or if this is a problem that could be solved in Tramp
>>> (with extra caching?)
>> What do you think should be cached in Tramp?
>
> Not sure if more cache should be the answer here, but in the profile I
> see the hack-dir-local-variables call.
>
> So first, it should do nothing unless enable-remote-dir-locals is set
> to t (right?), so my first guess would be Ergus has customized that
> var. Maybe try turning it off, does that lose some features that you
> use?

Neither Tramp nor connection-local variables need this. Perhaps, it is a
good idea idea to bind enable-remote-dir-locals to nil in
project-mode-line-format.

> Second, I suppose Tramp could do some caching for the result of
> hack-dir-local--get-variables (just time-based), but I'm not sure how
> much it will help, on average. Only every 100th redisplay causing a
> stutter would still be a problem.

A redisplay shouldn't happen anymore, at least not triggered by
Tramp. I've added the NODISP arg to the respective sit-for call.

Best regards, Michael.