Re: [PATCH 0/7] grep.c: teach --column to 'git-grep(1)'
- From
René Scharfe <l.s.r@web.de>
- Date
- Jun 19, 2018, 17:50 UTC
- Message-ID
- <838caafd-9172-3320-7d4c-b8e53eb3ea01@web.de>
- In-Reply-To
- <20180619174452.GA47272@syl.attlocal.net>
Am 19.06.2018 um 19:44 schrieb Taylor Blau:
Show 19 quoted lines
> On Tue, Jun 19, 2018 at 07:33:39PM +0200, René Scharfe wrote: >> Am 19.06.2018 um 18:35 schrieb Jeff King: >>> On Mon, Jun 18, 2018 at 06:43:01PM -0500, Taylor Blau wrote: >> We could add an optimizer pass to reduce the number of regular >> expressions in certain cases if that is really too slow. E.g. this: >> >> $ git grep -e b -e a >> >> ... is equivalent to: >> >> $ git grep -e '\(b\)\|\(a\)' >> >> In that example the optimizer should use a single kwset instead of a >> regex, but you get the idea, namely to leave the short-circuiting to the >> regex engine or kwset, which probably do a good job of it. > > I think that--while this pushes that decision to the appropriate level > of indirection--that it is out of scope for this series, and that the > above patch should do a sufficient job at not surprising users.
Definitely. I'm not even convinced that performance problem is real -- otherwise someone would have added such an optimization already, right? :)
René