From: Linus Torvalds Date: Mon, 11 Jan 2010 19:29:01 GMT Subject: Re: [PATCH] grep: do not do external grep on skip-worktree entries Message-ID: In-Reply-To: <4c8ef71001111119p253170f8q37bcd3708d894a62@mail.gmail.com> On Mon, 11 Jan 2010, Fredrik Kuivinen wrote: > > Any ideas on how this can be explained? Could it be a bad 'strstr()' implementation? Try a complex pattern ("qwerty.*as" finds the same line), and see if that too is slower than before. If that is faster than it used to be (with --no-ext-grep, of course), then it's strstr() that is badly implemented. For me, on x86-64 (Fedora-12), strstr() seems to do pretty well. But it's easy to do a stupid implementation of strstr that does a 'strlen()' first, for example, and thus always traverses all data _twice_ etc. Depending on cache sizes etc, that can end up killing performance (or not mattering much at all..) Linus