unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Paul Pogonyshev <pogonyshev@gmail.com>
Cc: 56342@debbugs.gnu.org
Subject: bug#56342: TRAMP (sh) issues way too many commands, thus being very slow over high-ping networks
Date: Mon, 04 Jul 2022 12:33:39 +0200	[thread overview]
Message-ID: <87wnctb20s.fsf@gmx.de> (raw)
In-Reply-To: <8735fjh5ge.fsf@gmx.de> (Michael Albinus's message of "Sat, 02 Jul 2022 17:58:25 +0200")

Michael Albinus <michael.albinus@gmx.de> writes:

Hi Paul,

>> Suggested improvements:
>>
>> * TRAMP should issue just one `stat' command to find out most of the
>> things about a file: whether it exists, if it is a directory, its real
>> name when dereferencing links and whatever stats it is used to find
>> now; from `$ stat --help' this seems to be possible. In other words,
>> TRAMP shouldn't use simple commands like `test -e': any ping, even
>> nominal, will negate any gains from using a tad faster command.
>> Instead, if it needs to find anything about a file, it should ask the
>> remote about as many things as possible in one go: it is very likely
>> that the additional information will be needed soon and even if not,
>> this is basically free compared to ping anyway.
>
> Not all remote hosts carry a stat command, and not all existing stat's
> are GNU compatible. But yes, if possible, Tramp shall gather as much
> information in one run, and cache the results for further use.

FTR, stat is not sufficient to detect the real file name. Example:

# touch /tmp/a
# ln -s /tmp/a /tmp/b
# ln -s /tmp/b /tmp/c
# stat -c %N /tmp/c

It returns "'/tmp/c' -> '/tmp/b'". However, we need "/tmp/a". So we must
still use "readlink --canonicalize".

Best regards, Michael.





      parent reply	other threads:[~2022-07-04 10:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-01 17:14 bug#56342: TRAMP (sh) issues way too many commands, thus being very slow over high-ping networks Paul Pogonyshev
2022-07-02 15:58 ` Michael Albinus
2022-07-02 18:14   ` Paul Pogonyshev
2022-07-03 12:16     ` Michael Albinus
2022-07-03 14:00       ` Paul Pogonyshev
2022-07-03 18:47         ` Michael Albinus
2022-07-03 19:52           ` Paul Pogonyshev
2022-07-04 11:19             ` Michael Albinus
2022-07-04 14:42               ` Paul Pogonyshev
2022-07-04 16:30                 ` Michael Albinus
2022-07-26  8:00                   ` Paul Pogonyshev
2022-07-26 14:18                     ` Michael Albinus
2022-07-26 16:17                       ` Paul Pogonyshev
2022-07-26 17:51                         ` Michael Albinus
2022-08-01 20:20                           ` Paul Pogonyshev
2022-08-02 14:23                             ` Michael Albinus
2024-05-20  0:04                               ` Dmitry Gutov
2022-07-04 10:33   ` Michael Albinus [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=87wnctb20s.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=56342@debbugs.gnu.org \
    --cc=pogonyshev@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).