From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs 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 Message-ID: <87wnctb20s.fsf@gmx.de> References: <8735fjh5ge.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1503"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 56342@debbugs.gnu.org To: Paul Pogonyshev Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 04 12:34:11 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o8JP8-0000Hc-Tc for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Jul 2022 12:34:10 +0200 Original-Received: from localhost ([::1]:41120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8JP7-0001gG-HM for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Jul 2022 06:34:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8JP0-0001g5-Va for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2022 06:34:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52282) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o8JP0-00063R-EK for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2022 06:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o8JP0-0000iC-BQ for bug-gnu-emacs@gnu.org; Mon, 04 Jul 2022 06:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Jul 2022 10:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56342 X-GNU-PR-Package: emacs Original-Received: via spool by 56342-submit@debbugs.gnu.org id=B56342.16569308362722 (code B ref 56342); Mon, 04 Jul 2022 10:34:02 +0000 Original-Received: (at 56342) by debbugs.gnu.org; 4 Jul 2022 10:33:56 +0000 Original-Received: from localhost ([127.0.0.1]:46179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8JOu-0000hp-2l for submit@debbugs.gnu.org; Mon, 04 Jul 2022 06:33:56 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:44073) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8JOn-0000hV-No for 56342@debbugs.gnu.org; Mon, 04 Jul 2022 06:33:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1656930823; bh=oHvJohFq3CH1KTNEH1WX4jkHgUcsxvAqLcrXPi6Amkc=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=M8Ch6KF4agNgTvscoHx4C0miGP/xHA2pYmPmBRF+9RKJxu5R++AVYoxktgVGqHiJm COuIMBudUYfmlG2xclaR3cnAwY2YMiZs+S62eC0Jc7nUbkrDoo/oKzA6jlumSOB74u /BE4pnGMQJfO2t2SNT2Gvq3wsy0Tv0vZPfj64pHk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([79.140.119.4]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mn2aN-1nidhB2C2B-00k8qV; Mon, 04 Jul 2022 12:33:43 +0200 In-Reply-To: <8735fjh5ge.fsf@gmx.de> (Michael Albinus's message of "Sat, 02 Jul 2022 17:58:25 +0200") X-Provags-ID: V03:K1:6kO8ar5uvbON1/o84b/sOfWDqYIFvce4kN/1TBOaygJSzJSlphm YbpLeZUoNoyyLvba23pn7iiQq3MZe57OZZdl8nl2GbwmoWiBLNNbX6aTDDwdD/GAhgCXMFH HQC4g389TK9v2+kVaK6sITNOMZUWiPMP5yMWd50X8XewYNf/+IeJUyC9QQbNV5teID4RetU 8PAx7N7xKQk/SiL6Mh6cw== X-UI-Out-Filterresults: notjunk:1;V03:K0:HzkWuYWpokc=:3vx0tzUnXWz2y5jSdA/8sH xBoE2IfIQvqPfHvHi5tXqeGN/z1Kh1Z7uub1a46izbFNxNxMzCyVRTc/WAIZdbARfmGZwTCvm I0GLTfvY0dezTgEMyAOCpkoOxTp/T58u3O/QhG9ABV2c5sCblSyCpXutg75620yUIdSF/F0PN jXzGJaMpHyvDkYmZz4k1JR4X5O5g3d5RBKcEUG6G+PlXYAPnByh3nX9uVSFLkpiAyai4Cbst/ BoOvfBrpj2Vq/2jG7m7LsDEy3zXV5RHwiUO2e9NAlQhGbHRDNxQTetvu24jmizdziD/Z884WW UmcMoJHMOdbIwOqymgHokMvRvzf+Mml0+Nk5cjwZxJ2ySkLPFuP4lrRdJLPVglqmxKgIPLmFr 8VKAlVyYyTUwi9fRZeiqvsDAASOb1rT0bocBizb6i6chnE86noB9Sgc4tx9CmPC+toHhmIDin LZYL4mZcT1qOHN4Z5rZKFVQ7sKvprI5d/fmDnzOOVrTiOJQw9gGGduTEt/+pzA8hS4bqCWQZM SOnxJvewF24YpIjo2pCuaogyAZirqrYBgC48vGAt8WNxC7pAF2NR0R1iBKkruyclyDGsN90dy fk+BRs2NAJvUtkFQ2eSQYgJROGxIujjJwNzL9EKa2U+S4hj+YoTqgds+RB+m1xpCXJ2MFWDBY umq7PCLpcftDVQB9aAoQlPe25B9uDvDkIn/q9+Fkds/rw1QqDV23C+3dnp+/r7Y1PYtxD4OdV bFEmH3DiGUUmXWgPYevxPbR37bIetJYEYUXdqoRar46oL/YZ7wD5bO0TrOC9RUN/toOf4Kkw X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:236041 Archived-At: Michael Albinus 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.