unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Jim Porter <jporterbugs@gmail.com>
Cc: 51622@debbugs.gnu.org
Subject: bug#51622: 29.0.50; [PATCH v3] Abbreviate remote home directories in `abbreviate-file-name'
Date: Mon, 15 Nov 2021 17:59:25 +0100	[thread overview]
Message-ID: <87o86l9wya.fsf@gmx.de> (raw)
In-Reply-To: <6deae031-0bbd-9dec-d9d1-3e74e45acaeb@gmail.com> (Jim Porter's message of "Sun, 14 Nov 2021 22:58:31 -0800")

Jim Porter <jporterbugs@gmail.com> writes:

Hi Jim,

>> Thanks. However, I believe this test shall be called
>> `files-tests-file-name-non-special-file-abbreviate-file-name', like the
>> other non-special tests. And perhaps it shall be located prior
>> `files-tests-file-name-non-special-access-file'.
>
> Ok, done.

Thanks, I've pushed this to the master branch.

>> But it shouldn't be too hard to determine the defaults. We have
>> tramp-default-method{-alist}, tramp-default-user{-alist}, and
>> tramp-default-host{-alist}. All needed information is there.
>
> Right, that confirms what I suspected. I'll try to look into this in
> more detail later when I get the chance.

Would be interesting to see the result :-)

>>> I also attached a slightly-updated benchmark script as well as new
>>> results. Performance on local file names is the same as before the
>>> patch, and just slightly faster than before with Tramp file
>>> names. (Most of the performance improvements here happened in
>>> bug#51699, so I mainly wanted to maintain the current performance in
>>> this patch.)
>> Good, no regression :-)
>
> Fixing your comments below *did* regress performance for abbreviating
> Tramp file names compared to current master (it takes 1.47x as long
> now in the worst case), but it's still considerably faster than Emacs
> 28. I've attached updated benchmark results to show the difference.

Yes, that's the price we have to pay for clean code. I've explained why
it is needed.

However, the `tramp-file-name-handler' machinery has been grown over 20+
years. I'm not aware of useless stuff, but maybe it's worth to have an
*external* look at this wrt performance. Are you interested?

>> Well, I believe we can implement abbreviation also for other Tramp
>> backends, like in tramp-sudoedit.el. So it might be better to call this
>> handler `tramp-handle-abbreviate-file-name'.
>
> Done. I added this for the sudoedit and smb methods, since both support
> "~" expansion in `expand-file-name'. That *should* be sufficient, but
> I've never used either of those methods, so I could be wrong...

Thanks. I didn't find the time to check it for these methods, but it's
on my TODO for next days.

>> Please use `case-insensitive-p'. We don't know whether there will be
>> other implementation for this magic function in the future. And we shall
>> not bypass the checks in `tramp-file-name-handler', which are important
>> for parallel invocations of Tramp handlers.
>
> Fixed (same with `expand-file-name'). These changes slow things down a
> fair bit, but that's mostly due to checking for the right file name
> handler more often. Like I said above though, it's still a lot faster
> than Emacs 28 (thanks to bug#51699).

I've committed everything to master. Then I ran the regression tests,
and there were indeed some few surprises. All of them shall be fixed now
with my commit after yours.

I tend to close this bug report now, since everything reported has been
implemented. The open points don't need this bug anymore for progress.

WDYT?

Best regards, Michael.





  reply	other threads:[~2021-11-15 16:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-06  3:44 bug#51622: 29.0.50; [PATCH] Abbreviate remote home directories in `abbreviate-file-name' Jim Porter
2021-11-06  8:06 ` Eli Zaretskii
2021-11-06 15:34 ` Michael Albinus
2021-11-06 16:38   ` Jim Porter
2021-11-06 17:41     ` Michael Albinus
2021-11-07  3:30       ` bug#51622: 29.0.50; [PATCH v2] " Jim Porter
2021-11-07 18:37         ` Michael Albinus
2021-11-08  4:54           ` Jim Porter
2021-11-08 15:58             ` Michael Albinus
2021-11-08 18:32               ` Jim Porter
2021-11-08 19:18                 ` Michael Albinus
2021-11-14  2:10           ` Jim Porter
2021-11-14 14:43             ` Michael Albinus
2021-11-15  6:58               ` bug#51622: 29.0.50; [PATCH v3] " Jim Porter
2021-11-15 16:59                 ` Michael Albinus [this message]
2021-11-16  1:14                   ` Jim Porter
2021-11-16 11:43                     ` Michael Albinus
2021-11-16 12:57                   ` Michael Albinus

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=87o86l9wya.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=51622@debbugs.gnu.org \
    --cc=jporterbugs@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).