[Top][All Lists]

[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: Thu, 2 Jan 2020 04:22:16 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

Hi Michael,

On 01.01.2020 14:29, Michael Albinus wrote:
I've played a little bit with this. Even if there is no remote file name
involved, file-local-name is slow due to the file-remote-p call and the
file name handler mechanery. See:

This is unfortunate. But there's a bigger problem: file-local-name is even slower when the file name actually *is* remote.

Refactoring the code, and applying `file-local-name' just to the cases
where it is needed, shows an elapsed time similar to the initial one.

If you take a look at xref-matches-in-files, you will find that is exactly what I did.

But check this out:

ELISP> (benchmark-run-compiled
  (dotimes (i 10000) (file-local-name (format "/tmp/%d" i))))

(0.01541569 0 0.0)

ELISP> (benchmark-run-compiled
  (dotimes (_i 10000) (file-local-name (format "/ssh:abc@def.com:/"))))
(3.229403787 28 1.9053286330000034)

And that is for just 10'000 files, not for 1'000'000.

And with longer file names, the process takes even longer (twice as long in my real-world example).

reply via email to

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