Re: [PATCH v2 4/7] grep: add support for the PCRE v1 JIT API

2017-05-24 Thread Ævar Arnfjörð Bjarmason
On Wed, May 24, 2017 at 7:17 AM, Junio C Hamano wrote: > Ævar Arnfjörð Bjarmason writes: > >> diff --git a/grep.c b/grep.c >> index 1157529115..49e9aed457 100644 >> --- a/grep.c >> +++ b/grep.c >> @@ -351,6 +351,9 @@ static void compile_pcre1_regexp(struct grep_pat *p, >> const struct grep_opt

Re: [PATCH v2 4/7] grep: add support for the PCRE v1 JIT API

2017-05-23 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > diff --git a/grep.c b/grep.c > index 1157529115..49e9aed457 100644 > --- a/grep.c > +++ b/grep.c > @@ -351,6 +351,9 @@ static void compile_pcre1_regexp(struct grep_pat *p, > const struct grep_opt *opt) > const char *error; > int erroffset; > i

[PATCH v2 4/7] grep: add support for the PCRE v1 JIT API

2017-05-23 Thread Ævar Arnfjörð Bjarmason
Change the grep PCRE v1 code to use JIT when available. When PCRE support was initially added in commit 63e7e9d8b6 ("git-grep: Learn PCRE", 2011-05-09) PCRE had no JIT support, it was integrated into 8.20 released on 2011-10-21. Enabling JIT support usually improves performance by more than 40%. T

Re: [PATCH v2 4/7] grep: add support for the PCRE v1 JIT API

2017-05-14 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: >> Yes I could do that, no reason not to, and as you point out it would >> reduce duplication. >> >> I wrote it like this trying to preserve the indentation with/without >> the macro being true, thinking someone would have an issue with it >> otherwise. >> >> I als

Re: [PATCH v2 4/7] grep: add support for the PCRE v1 JIT API

2017-05-14 Thread Ævar Arnfjörð Bjarmason
On Sun, May 14, 2017 at 5:10 PM, Ævar Arnfjörð Bjarmason wrote: > On Sun, May 14, 2017 at 4:43 PM, Simon Ruderich wrote: >> On Sat, May 13, 2017 at 11:45:32PM +, Ęvar Arnfjörš Bjarmason wrote: >>> [snip] >>> >>> +#ifdef PCRE_CONFIG_JIT >>> + if (p->pcre1_jit_on) >>> + ret = pc

Re: [PATCH v2 4/7] grep: add support for the PCRE v1 JIT API

2017-05-14 Thread Ævar Arnfjörð Bjarmason
On Sun, May 14, 2017 at 4:43 PM, Simon Ruderich wrote: > On Sat, May 13, 2017 at 11:45:32PM +, Ęvar Arnfjörš Bjarmason wrote: >> [snip] >> >> +#ifdef PCRE_CONFIG_JIT >> + if (p->pcre1_jit_on) >> + ret = pcre_jit_exec(p->pcre1_regexp, p->pcre1_extra_info, line, >> +

Re: [PATCH v2 4/7] grep: add support for the PCRE v1 JIT API

2017-05-14 Thread Simon Ruderich
On Sat, May 13, 2017 at 11:45:32PM +, Ævar Arnfjörð Bjarmason wrote: > [snip] > > +#ifdef PCRE_CONFIG_JIT > + if (p->pcre1_jit_on) > + ret = pcre_jit_exec(p->pcre1_regexp, p->pcre1_extra_info, line, > + eol - line, 0, flags, ovector, > +

[PATCH v2 4/7] grep: add support for the PCRE v1 JIT API

2017-05-13 Thread Ævar Arnfjörð Bjarmason
Change the grep PCRE v1 code to use JIT when available. When PCRE support was initially added in commit 63e7e9d8b6 ("git-grep: Learn PCRE", 2011-05-09) PCRE had no JIT support, it was integrated into 8.20 released on 2011-10-21. Enabling JIT support usually improves performance by more than 40%. T