GNU bug report logs - #34343
[PATCH] Make project--find-regexp-in-files work with remote files

Previous Next

Package: emacs;

Reported by: Felicián Németh <felician.nemeth <at> gmail.com>

Date: Wed, 6 Feb 2019 08:19:01 UTC

Severity: normal

Tags: moreinfo, patch

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 34343 <at> debbugs.gnu.org, Felicián Németh <felician.nemeth <at> gmail.com>
Subject: bug#34343: [PATCH] Make project--find-regexp-in-files work with remote files
Date: Thu, 2 Jan 2020 04:22:16 +0300
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
    nil
  (dotimes (i 10000) (file-local-name (format "/tmp/%d" i))))

(0.01541569 0 0.0)

ELISP> (benchmark-run-compiled
    nil
  (dotimes (_i 10000) (file-local-name (format "/ssh:abc <at> 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).




This bug report was last modified 3 years and 303 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.