aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorSpencer Baugh2024-05-26 09:26:09 -0400
committerStefan Kangas2024-06-02 12:43:09 +0200
commitb71fa27987d89774c84b0c9362ddfb4a0f679856 (patch)
tree454869738f3c9774af5c6044e17db4d58607a4a0 /java
parent7983f882823bafd5dd834c24d4defb26525f687b (diff)
downloademacs-b71fa27987d89774c84b0c9362ddfb4a0f679856.tar.gz
emacs-b71fa27987d89774c84b0c9362ddfb4a0f679856.zip
In rgrep, check matching files before excluding files
There are a lot of excluding globs, and checking them all is expensive. The files glob (i.e. the glob for files we actually want) is usually just one or two entries, so it's quite fast to check. If find checks the files glob first and then the excluding glob, it has to do much less checking (since the files glob will substantially narrow down the set of files on its own), and find performance is much better. In my benchmarking, this takes (rgrep "foo" "*.el" "~/src/emacs/trunk/") from ~410ms to ~130ms. Further optimizations are possible now that the ignores and matched files are in the same <F> argument which can be rearranged more easily without compatibility issues; I'll do those optimizations in later commits. * lisp/progmodes/grep.el (rgrep-find-ignores-in-<f>): Add. * lisp/progmodes/grep.el (rgrep-default-command): Check rgrep-find-ignores-in-<f> and move the excluded files glob to part of the "files" argument. (Bug#71179)
Diffstat (limited to 'java')
0 files changed, 0 insertions, 0 deletions