Note on "git grep"

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:33

Heh. Since I've been bisecting a laptop of mine that keeps having ACPI 
problems, I notived something fun about "git grep".

Using the external "grep" is about 10 times faster for the hot-cache case, 
but for cold-cache, forcing the internal one is actually a _lot_ faster 
because a fully packed kernel archive just gets wonderfully better IO 
patterns than the "real filesystem" image.

So doing "git grep some-random-string HEAD" takes about 16 seconds 
cold-cache, and 11 seconds hot-cache.

In contrast, doing "git grep some-random-string" takes over a minute 
cold-cache, and about 2 seconds hot-cache. It's kind of sad that we can't 
dynamically notice which case we have, since the hot-cache case is _so_ 
much better for the external grep, but then cold-cache sucks for it..

I just thought I'd point this out to people, since I found it interesting 
how the built-in grep functionality actually outperforms the "real" one 
under some circumstances.

		Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help