Subject: bug#73046: 29.4; Emacs 100% CPU usage for several seconds when opening dired buffer over TRAMP

From: Eli Zaretskii <[email-masked]>
Date: Sat, 07 Sep 2024 18:07:17 +0300

> From: Michael Albinus <[email-masked]>
> Cc: Suhail Singh <[email-masked]>,  [email-masked]
> Date: Sat, 07 Sep 2024 16:36:42 +0200
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > Michael, what do these checks entail, and why are they so
> > CPU-expensive and take a lot of time with slow connections?
> 
> I made a test. In a remote directory I have created a cyclic symlink
> "zzz", in order to see what Tramp does when running dired on the
> directory. The additional actions are
> [...]
> 15 times the "test -h" command - I guess, Tramp shall do cyclic link
> detection better.

I agree.  But that only explains the time delay, no why Emacs is
consuming 100% of CPU, right?  Waiting for the network should not
consume CPU, unless I'm missing something.

Also, Suhail Singh says that there's a significant delay when there
are valid symlinks, in which case I don't expect Tramp to issue the
same command 15 times, right?

I'm sorry to insist on understanding these fine details, but my
experience is that without a good understanding of a problem we might
devise a solution that is only a partial one.

Thanks.