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: Tue, 02 Aug 2022 16:23:18 +0200 Message-ID: <87o7x22089.fsf@gmx.de> References: <8735fjh5ge.fsf@gmx.de> <87v8sefl2f.fsf@gmx.de> <874jzyc9u9.fsf@gmx.de> <87sfnhazvy.fsf@gmx.de> <87k08sc02z.fsf@gmx.de> <87r128gdob.fsf@gmx.de> <87mtcvhidx.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12695"; 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 Tue Aug 02 16:24:12 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 1oIsod-00038h-VH for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 02 Aug 2022 16:24:12 +0200 Original-Received: from localhost ([::1]:45036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oIsoc-0004lm-HI for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 02 Aug 2022 10:24:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48500) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oIsoU-0004lL-CG for bug-gnu-emacs@gnu.org; Tue, 02 Aug 2022 10:24:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54902) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oIsoU-0000jd-3i for bug-gnu-emacs@gnu.org; Tue, 02 Aug 2022 10:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oIsoT-0007xr-N9 for bug-gnu-emacs@gnu.org; Tue, 02 Aug 2022 10:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 Aug 2022 14:24:01 +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.165945020930577 (code B ref 56342); Tue, 02 Aug 2022 14:24:01 +0000 Original-Received: (at 56342) by debbugs.gnu.org; 2 Aug 2022 14:23:29 +0000 Original-Received: from localhost ([127.0.0.1]:44651 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIsnx-0007x6-Bl for submit@debbugs.gnu.org; Tue, 02 Aug 2022 10:23:29 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:47123) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIsnv-0007ws-0y for 56342@debbugs.gnu.org; Tue, 02 Aug 2022 10:23:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1659450200; bh=rbPqwGVaYBK4Y3cb8m6tvuEkIdqoohWpw5o4IN2mmKw=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=afLnSMPxu6Lcn7nu1Z9u5H/vzN/cSu0og3l8LUWh4Go0TRzLCMzK1Jmyg8dG/me/w UcyaL7dYWG39pDH3eo6iBzJQj1KGZTd7EWlGQm8e0jmqrg4aCgBga0mX+pSc+J5x0a cH2jyuDQ9QSgO/fsxqfvnAgZIkm9wnAyv+LXWd24= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([213.220.149.238]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MmULr-1naiIQ3z7J-00iUcd; Tue, 02 Aug 2022 16:23:20 +0200 In-Reply-To: (Paul Pogonyshev's message of "Mon, 1 Aug 2022 22:20:41 +0200") X-Provags-ID: V03:K1:RtC6lBH9r/qi7V/eCsLw7BaUb2k0aIsBFr5MfrA9XMiEg/SdJqN djZw3QHMY0OFJtsvesbx3WAn/kX8465NliiHIfEoZjoToTB42hG1m7h7J/k08u6Wmqytb/p yjzllDxv7J4MOplBFq7QGzaas52kR7EsDIYdy1hJmAx1MBDNOxNVU8goyvG9vaMpV3CqEVR +uCsQz7G4YyX5aYwg4ekg== X-UI-Out-Filterresults: notjunk:1;V03:K0:5Qm1KTtVKF0=:i2ivwQlGD7cC9ZLGH0+CAp 69Abq7W9myMbVFU1T2jcreQryiBRbryLs8hGVbS/lb5Qc4Q8WLTjNLPzrTPqXs4s07s0xvDuj z7CLtxDKGu4TA5bPn1+18aKppvMjrcqTrlt5uUMjh+CgiRIDxxQZJ7SWH33FH9/HBIrEnjcZN 3w/JEkXcRayff2qGRUP+l/mpkSP4iaMgYxk9pPPuXQsINR68X4wQPpKl0K1x/FZbalCria5GA LlP/dEhjTpBZJoa3JiYIGg8HtrDVxfyRClZdUHQJIm81vnZY9gg5Y8R/FWRCFOFtghQIQOjVG EF8Rqw9eldqU8KJ7Em0f0chJRXJ7hO5z4GEimHuNTNAc2K1S9BSBprIj6mFDRb/IgNLWzhmaW D97hSJxEpHkW2Doh7t5LAqHjNNNmRPiUCGA5KE83rkFsFenRYtyOlJHqj+a6wfblJOUeDrLvR pL3tDbN5+35xx9/pAX52X4Gf649Le4KDjuDmcCQ9VbmBS6vzm1SkBUs8u3pJcmur2sg6LwHqk CucOUv22O/4RbJrhyHpWJ77bKvl34FuYvWX6sCyUQGZcgAY06ng8WEWIi0+PgWxLISAq24U/6 8qbj0YWfjJ6iQe8BwYrXC7dLDEXia2/6i5XK0ojUHDTAR/hXF5YSaLs9mEc8TI3S9cKvyjbJ/ gIEjKv8RVaVoeZMg7X8hVp3I+ZNjYGV+DFHeHNhJMpBgw2KLp0vlfM4OfszANwVBiuqWtYAIk /eBO2G9zO8bYnz6rFkObP2WRs2/ooXwV3/zXX1KAyyD04DHjWXQXrMrcZTMozKwHH2iQi+XI 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:238556 Archived-At: Paul Pogonyshev writes: Hi Paul, > Understood, but I propose to adopt a different benchmark: number of > remote commands. As soon as you are not in a LAN, even not when using > a particularly slow network, this becomes an order or two of magnitude > more important than everything else. E.g. with slightly slower > commands or particularly inefficient Elisp you can make it 2-10 ms > slower for everyone. But with unoptimized command flow (i.e. more > remote commands) it can be 100-500 ms slower, though not for everyone, > but people using this over non-LAN. I think in such cases extremes > are more important than the average. I agree, sending something over the wire is always slower than computing clever caches locally. >> And directories are also problematic for caches. As soon as something >> changes there (creation or deletion of a file, for example), the cached >> values of the directory must be flushed. > > Yeah, I suppose Tramp has no generic way to know that Magit issues > reading commands. Can we devise a generic interface that would tell > Tramp: "Commands within this block will not modify file system", > e.g. with let-binding some variable? They will modify the file system, although sometimes only the timestamps. Until now we have only something similar for synchronous processes: process-file-side-effects. I have no idea whether package authors are aware of this, and let-bind it to nil in case of. In the magit sources, I haven't found this variable. > In general, it feels like Tramp flushes its caches too often or maybe > doesn't even cache certain things at all. I.e. it's not about those > 10 seconds (following your advice I have even increased that). It's > that while serving one user-level command here (i.e. within 3 seconds > at most), it can issue the same remote command several times, thus > not reusing previous results. Well, that's right. If, for example, the file modes are changed, Tramp flushes all caches for that file, although some of them ("file-exists-p", "file-directory-p" etc) aren't affected. > E.g. in the traces you have attached this can be seen. The following > two commands repeat twice: I haven't investigated this special case yet, but last days I'm working on exact this problem. Flushing caches shouldn't be a sledge hammer, but fine grained, selecting the needed properties to be flushed. Let's see where we land. > Paul Best regards, Michael.