Re: [PATCH v2 3/3] grep: disable threading in all but worktree case
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Dec 24, 2011, 10:55 UTC
- Message-ID
- <CACsJy8DbfE8r3KsxCnb30-sb3LUAAWapAKJUSJ1zBZme1FoMwg@mail.gmail.com>
- In-Reply-To
- <20111224070715.GA32267@sigill.intra.peff.net>
(Sorry I replied without reading though the mail)
On Sat, Dec 24, 2011 at 2:07 PM, Jeff King <peff@peff.net> wrote:
Show 19 quoted lines
> The case where we would most expect the setup cost to be drowned out is > using a more complex regex, grepping tree objects. There we have a > baseline of: > > $ time git grep 'a.*c' HEAD >/dev/null > real 0m5.684s > user 0m5.472s > sys 0m0.196s > > $ time git ls-tree --name-only -r HEAD | > xargs git grep 'a.*c' HEAD -- >/dev/null > real 0m10.906s > user 0m10.725s > sys 0m0.240s > > Here, we still almost double our time. It looks like we don't use the > same pathspec matching code in this case. But we do waste a lot of extra > time zlib-inflating the trees in "ls-tree", only to do it separately in > "grep".
I assume this is gree_tree(), we have another form of pathspec matching here: tree_entry_interesting() and it's still a bunch of strcmp inside. Does strcmp show up in perf report?
-- Duy