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#51699: 29.0.50; [PATCH] Improve performance of 'file-name-case-insensitive-p' for Tramp files Date: Tue, 09 Nov 2021 20:34:01 +0100 Message-ID: <87ee7pqg2e.fsf@gmx.de> References: <0b41b0c1-0887-8a21-e2e4-eeb35d5a9bd0@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10929"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 51699@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 09 20:35:32 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 1mkWu4-0002ha-5l for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Nov 2021 20:35:32 +0100 Original-Received: from localhost ([::1]:41488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mkWu3-0003hS-35 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Nov 2021 14:35:31 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mkWta-0003gf-A4 for bug-gnu-emacs@gnu.org; Tue, 09 Nov 2021 14:35:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52548) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mkWta-0008R6-1h for bug-gnu-emacs@gnu.org; Tue, 09 Nov 2021 14:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mkWtZ-0001yk-Sy for bug-gnu-emacs@gnu.org; Tue, 09 Nov 2021 14:35:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Nov 2021 19:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51699 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 51699-submit@debbugs.gnu.org id=B51699.16364864537545 (code B ref 51699); Tue, 09 Nov 2021 19:35:01 +0000 Original-Received: (at 51699) by debbugs.gnu.org; 9 Nov 2021 19:34:13 +0000 Original-Received: from localhost ([127.0.0.1]:35860 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mkWsn-0001xd-Be for submit@debbugs.gnu.org; Tue, 09 Nov 2021 14:34:13 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:35765) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mkWsj-0001xK-QN for 51699@debbugs.gnu.org; Tue, 09 Nov 2021 14:34:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1636486443; bh=44zmKVlzYwCozszhBxm7Nd5V1CywhxcCDL06vFFB63s=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=GFW67RMYDPYNpwwB8RMM3hfZqRgEbEF8Xuw6FC/YGLvZdF56PopuZ0cX3wgmTLTDk niRWHzFsHTbWPCqzw8fi6xuYjUv7jaF1rFC5VniEkPtaqoQfVL7lyX1Y2zKg8dnMr8 0MfnJpAJD+jqyaM0xmSEMd1I+Hl74zxOFtJZnuCw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([79.140.125.138]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MFKGP-1mvqTb3HbN-00FoG5; Tue, 09 Nov 2021 20:34:02 +0100 In-Reply-To: <0b41b0c1-0887-8a21-e2e4-eeb35d5a9bd0@gmail.com> (Jim Porter's message of "Mon, 8 Nov 2021 19:46:05 -0800") X-Provags-ID: V03:K1:SIQaCNsIUVlf2ENMMNera9HmzK9ouqP+TnrMsxl31LzFWUSpt/M RdmzqviTjKBsKmIGkAt/dbEJ4R8gp93lUCf5cL4by7wPBGVyOJEtbQXpBXM7at+aivU+zC6 pmvyFuezF0lEjGy535zLuTuxSKYn3zUUJWKMb8OYp6wOKzkYZM+OCDXDkOZYcgIbmvq2mUz TJiHGTRET8nXFMbsvcocQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:A0y9URlFmh4=:tEjcMTzc8dQEWvrLXu843o gws6KLLTnh9RjeBhdUIpeBBWCowkRDtaGs0sGMjFEd9O6D9uCNMHGtUaZqPI309/0jCDirouL VmCpjzqa1X2RJEA2m9ZtxtBFiAGh1iP4yd7+rGHb08doS18YNTtDvDG8JPFEZLM+Hv3PnH0k5 IYGYTOqDY66DsWT7oTOb9t14FQTvnzLYaiWbGG4aldQbNQBJUTkJJWennLJb27XHge0J3iT+t ElCf9q80Sw0fT06GMV8q9YDU+3t9BV1VJ+BOro25gVr0Guo6qKUB8QMSbVwy1RBTKl8DpjL3Z +c6/kNIhE+HQ3K2EpmehgLubktH7dv6AY8DbgGT/g46R6Pi+0N2LKvfGifHLI/DPudUEq2Y5v Zdd48xplluZy2hzz5sgnbzsdkqETyd3eqMVD4XxROoxU4HwlnPfgZI/6yjTNamVelUnjxDl+Y AD8vKKS5z5Yc6X2wy/SoWw2fzAEGxtSXSyRieWz8zCMViG38l0OjhEFxsPS0VHqtQ5BJKE7al 3R0VGxwiVw1GHxgWMrkt2HbqTKoGWoHJGtcZho5A91x24fEtqKMI1CzIzCXLOnFSxWqAi1ZKC AhkmugmBkUrc8K1a+wel4ziaL5ncHd2iDh8XtVflvFN1HgmHe1iG0LhCzZyfyZjnD7Xe5xzpB UwTjJjsqDOestVZosCyfnMvYRRtJbETk5vTJVLzLDbPjM5NHppBCIFiUIYi8VB0I+DAKSWoY5 n6m2PwYIRyK54O5UqnHrPgy5W/de3s4srIb8US0EimK9i1XnZwF73J3Iz5pBCHLf8R3utodj 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:219472 Archived-At: Jim Porter writes: Hi Jim, > 1) 'tramp-handle-file-name-case-insensitive-p' calling 'file-remote-p' > and 'expand-file-name' > > Since 'file-remote-p' only needed to check whether a connection was > already established, it could be replaced with this (thanks to Michael > Albinus for the pointer): > > (let ((non-essential t)) (tramp-connectable-p v)) > > 'expand-file-name' also had room for a small optimization, since it > previously called 'tramp-connectable-p' (which dissects the file if > it's not already) and then 'with-parsed-tramp-file-name' (which > dissects it again). I reversed the order so now there's one fewer > dissection, and it's a bit faster. This is obviously fine, so I've pushed this to master. Thanks for the improvement! > 2) Potential handlers in 'tramp-find-foreign-file-name-handler' each > dissect the file name > > Most Tramp methods have a 'tramp-FOO-file-name-p', and most of *those* > take a file name string and dissect it. This is a lot of duplicated > effort, so I modified 'tramp-find-foreign-file-name-handler' to pass > the dissected file name to any of the functions that support it (this > is indicated by an 'accepts-vec' property on the function). This > probably warrants some documentation (at least a NEWS entry), but I > wanted to be sure the strategy made sense before I wrote any docs. Yes, this makes sense, and it works in my environment (more regression tests running). I don't understand why you need the 'accepts-vec' property -- is there any operation left, which is passed to `tramp-find-foreign-file-name-handler' and which doesn't accept a VEC, after applying your patch? And if yes, couldn't we apply usual error handling? We shall not add this additonal complexity to Tramp. Best regards, Michael.