bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#34343: [PATCH] Make project--find-regexp-in-files work with remote f


From: Dmitry Gutov
Subject: bug#34343: [PATCH] Make project--find-regexp-in-files work with remote files
Date: Fri, 3 Jan 2020 03:52:27 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

On 02.01.2020 12:48, Michael Albinus wrote:
Then I have removed everything from tramp-handle-file-remote-p which
isn't necessary for the 'localname case, and I came to
 ...
I cannot confirm "twice as long". I've tried ...

My file names are longer still. I can give a specific example later, if you like.

The difference is likely because tramp-file-name-regexp has been
applied to a longer string.

If I simplify tramp-file-name-regexp, we get ...

Both are fine avenues for exploration, I think.

But most importantly for now: tramp-handle-file-remote-p does not take up the majority of time spent in file-remote-p. tramp-file-name-handler does:

ELISP> (benchmark 10000 '(file-remote-p "/ssh:abc@def.com:/%d"
                                 nil t))
"Elapsed time: 3.535115s (2.112970s in 27 GCs)"

ELISP> (benchmark 10000 '(tramp-handle-file-remote-p "/ssh:abc@def.com:/%d" nil t))
"Elapsed time: 0.780867s (0.645621s in 8 GCs)"

ELISP> (benchmark 10000 '(find-file-name-handler "/ssh:abc@def.com:/" 'file-remote-p))
"Elapsed time: 0.070135s"

ELISP> (benchmark 10000 '(tramp-file-name-handler 'file-remote-p "/ssh:abc@def.com:/%d" nil t))
"Elapsed time: 3.409674s (2.070461s in 27 GCs)"

And that function does a lot of things that I'm not sure we need to just get the remote id.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]