From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#49264: 28.0.50; project.el+tramp performance issue Date: Tue, 17 Aug 2021 02:45:51 +0200 Message-ID: <20210817004551.25qheo6v2gfys3ie@Ergus> References: <20210726165610.7pjiyuz4vtxuhgq7.ref@Ergus> <20210726165610.7pjiyuz4vtxuhgq7@Ergus> <14a3d5a3-33bf-cc82-d144-7302629aa33b@yandex.ru> <73afb142-38f4-9e0e-ee46-14ff70db5b72@yandex.ru> Reply-To: Ergus Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15563"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 49264@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 17 02:47:18 2021 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 1mFnG9-0003oY-5R for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 17 Aug 2021 02:47:17 +0200 Original-Received: from localhost ([::1]:33862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mFnG6-0002Js-LA for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 16 Aug 2021 20:47:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mFnFt-0002JI-Vt for bug-gnu-emacs@gnu.org; Mon, 16 Aug 2021 20:47:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39632) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mFnFt-0001d2-ON for bug-gnu-emacs@gnu.org; Mon, 16 Aug 2021 20:47:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mFnFt-00044l-Mu for bug-gnu-emacs@gnu.org; Mon, 16 Aug 2021 20:47:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ergus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Aug 2021 00:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49264 X-GNU-PR-Package: emacs Original-Received: via spool by 49264-submit@debbugs.gnu.org id=B49264.162916118715622 (code B ref 49264); Tue, 17 Aug 2021 00:47:01 +0000 Original-Received: (at 49264) by debbugs.gnu.org; 17 Aug 2021 00:46:27 +0000 Original-Received: from localhost ([127.0.0.1]:51178 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFnFL-00043u-Ee for submit@debbugs.gnu.org; Mon, 16 Aug 2021 20:46:27 -0400 Original-Received: from sonic302-3.consmr.mail.bf2.yahoo.com ([74.6.135.42]:42631) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFnFH-00043e-4b for 49264@debbugs.gnu.org; Mon, 16 Aug 2021 20:46:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1629161176; bh=ZbiMqs2G6oWIYgb+PW6c1OmYeC+VYQiV61KvXNCnbpM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject:Reply-To; b=Y8B2TcZDTMvb9XzBaPxpA/e8gmfm07tVWejT+04I8z57umdnJF+PU8JK/OczgBcr2B633Zt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VTQQNsnQ0o4b8urCbkgrrvopgKwV5vlzskYxI5H3qtVg8_pHLEUZgY.uW7W9IMyFf9cAPY5RZoj b_zfFwQzvjxFkHMM4HabNc92FHVsWbQw0cb5Um39Yw6Eh.dwxjA0_.PhiVJUM8Z1nDfv0ziG2EOT fler7Py.n9ubN4xTpQQ.TtSSrKqd5k2S3bS0meuQBljknzTFeJ08svYWPShqyweNrOjxx1FKhXBC VhzXDVdaS.zFdBc0LGQ6xYH2_rsZUE24v8HR_edwQiW.Sfc6PVbJ9uLyAFOZM_s1bEq4SvnQsf2B DIdqcXfdsn_ApsHaMfvGMjvmzfQv2wXF.sDnNj0zRefD4JuMSgXoGM2IpEhrTaMZn3wKrUz5Z0iW YB7yFOKApvTlGb1RAEKdIAXJo769HNzqCB1vZo7eacv0ckv0AocoHUea9KSSa_550oU4rb.0huJh myKzmPScHAD3cXg41zHJwqcgM4b84h6Z7C.j6YW7cpry7zNTLT7u3GnTn.zi0qrheqN.lTEFfMMw Ry_2R2xmDp5L06Y1euWosb2ALRD23ltEb7KAWH9jz. X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.bf2.yahoo.com with HTTP; Tue, 17 Aug 2021 00:46:16 +0000 Original-Received: by kubenode514.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID fa0259ab8f224f541284fdb7e1125ec8; Tue, 17 Aug 2021 00:46:13 +0000 (UTC) Content-Disposition: inline In-Reply-To: <73afb142-38f4-9e0e-ee46-14ff70db5b72@yandex.ru> X-Mailer: WebService/1.1.18850 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol 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:212069 Archived-At: On Mon, Aug 09, 2021 at 03:59:55AM +0300, Dmitry Gutov wrote: >Hi again, > >On 27.07.2021 02:04, Dmitry Gutov wrote: > >Sorry for the long wait, this feature ties into another old >discussion, and I wasn't sure how to proceed best. > >Anyway, here's a patch to try (attached). It should recover >performance lost back in 4ca13d98c9e while retaining flexibility (and >even adding more). > >There are still less than optimal places there (e.g. >file-in-directory-p is not very fast), and the modules list is read >from the disk every time, so some further optimization should be >possible. > >But first please try this version. Thanks Dmitry: This patch reduced the C-x p b time to just a few (~5) seconds when I have like 20 remote buffers. At the moment I haven't have time to stress it a bit more, but it improves the situation significantly compared to the previous situation. In my opinion this is a good improvement and may be installed on master, but probably it is not enough. I made a manual fast profiling and I see that most of the time in project-buffers actually goes to tramp-sh-file-name-handler. 207 42% - project-buffers 207 42% - apply 207 42% - # 200 40% - file-in-directory-p 200 40% - tramp-file-name-handler 197 40% - apply 197 40% - tramp-sh-file-name-handler 197 40% - tramp-handle-file-in-directory-p 183 37% - tramp-run-real-handler 183 37% - file-in-directory-p 124 25% - file-equal-p 124 25% - tramp-file-name-handler 121 24% - apply 121 24% - tramp-sh-file-name-handler 121 24% - tramp-handle-file-equal-p 85 17% - tramp-run-real-handler 85 17% - file-equal-p 52 10% - file-truename 52 10% - tramp-file-name-handler 41 8% - apply 41 8% - tramp-sh-file-name-handler 41 8% - tramp-sh-handle-file-truename 28 5% + file-remote-p 10 2% + file-local-name 3 0% + file-name-as-directory It goes specifically to file-in-directory-p as you said. So maybe the improvement there may be also desirable if the difference after the optimization can reduce the time for file-in-directory-p (or the caller) at least to the half. So, very thanks again. Ergus.