From: Junio C Hamano Date: Wed, 01 Feb 2012 16:28:46 GMT Subject: Re: [PATCH] Don't search files with an unset "grep" attribute Message-ID: <7vd39y4iwx.fsf@alter.siamese.dyndns.org> In-Reply-To: <20120201091009.GA20984@sigill.intra.peff.net> Jeff King writes: > 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".