[Top][All Lists]

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

Re: [Emacs-diffs] master 55ec674: * lisp/multifile.el: New file, extract

From: Dmitry Gutov
Subject: Re: [Emacs-diffs] master 55ec674: * lisp/multifile.el: New file, extracted from etags.el
Date: Thu, 3 Jan 2019 14:45:29 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:64.0) Gecko/20100101 Thunderbird/64.0

On 03.01.2019 3:37, Juri Linkov wrote:

I tried with the latest c708231803 (at least ‘vc-log-mergebase’ shows
that it's the latest), but optimized:

       (dolist (f files)
         (process-send-string process f)
         (process-send-string process "\0"))

was replaced with

       (process-send-string process (mapconcat #'identity files "\0"))

with no performance impact.

I tried this modification before, and it was slower, probably because of extra memory allocation. But on your machine it's probably hard to notice.

Trying 446bcaed37 has no difference either.

That's unfortunate.

Are you sure that project-find-regexp uses ‘find ... -path’?

Of course. What else would it be using to get the list of files?

It delegates to xref-collect-matches which, as you can see, builds a grep-find command. The salient difference is that find sends its output directly to grep, instead of going through Emacs.

I see that slowness is because of many ‘-path’ filters used in project-files.o


It is indeed slower than 'git ls-files', and especially because of the filters, but see above.
At least test (split-string (shell-command-to-string "git ls-files -z") "\0" t)

Using this instead of ‘(project-files (project-current t))’:

(benchmark 10 '(project-files-pipe-grep "xyz1"))
=> 3s

So... I guess that's better. Have you tried running the same command in a terminal and timing it? I wonder how it compares. The terminal will show us the best possible speed.

reply via email to

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