Re: [PATCH] Don't search files with an unset "grep" attribute
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 1, 2012, 16:28 UTC
- Message-ID
- <7vd39y4iwx.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20120201091009.GA20984@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 11 quoted lines
> Part of the problem, I suspect, is that the attribute lookup code is > optimized for locality. We only unwind as much of the stack as we need, > so looking at "foo/bar/baz.c" after "foo/bar/bleep.c" is much cheaper > than looking at "some/other/directory.c". But with threaded grep, that > locality is likely lost, as we are mixing up attribute requests from > different threads. > > Given that binary lookup means we need every file's gitattribute, it > might be better to look them up serially at the beginning of the > program, and then pass the resulting userdiff driver to grep_buffer > along with each path.
Yeah, that was my impression when the performance of threaded grep was discussed, which was before this "let's honor binary attribute".