Re: [RFC PATCH v2] grep: allow for run time disabling of JIT in PCRE
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jul 31, 2019, 12:36 UTC
- Message-ID
- <nycvar.QRO.7.76.6.1907311434080.21907@tvgsbejvaqbjf.bet>
- In-Reply-To
- <CAPUEspjo3Uo8KtSYQ=uh+_gPEjb+dBdSPgsEVE1j1bOMPF=0DA@mail.gmail.com>
Hi Carlo,
On Mon, 29 Jul 2019, Carlo Arenas wrote:
Show 19 quoted lines
> On Mon, Jul 29, 2019 at 10:47 AM Junio C Hamano <gitster@pobox.com> wrote: > > René Scharfe <l.s.r@web.de> writes: > > >> +pcre.jit:: > > >> + If set to false, disable JIT when using PCRE. Defaults to > > >> + true. > > >> + if set to -1 will try first to use JIT and fallback to the > > >> + interpreter instead of returning an error. > > > > > > Why not implement only -1, without adding this config setting? > > > > ... nor command line option. If we have an auto-fallback, I would > > think that makes the most sense. IIRC the first iteration with only > > the configuration was really about working around the (non-working) > > pcre-jit---if we can self-detect and skip a non-working case, that > > would allow us to drop end-user facing knobs, which is ideal. > > because that was proposed earlier[1] and wasn't accepted ;) > [...] > [1] https://public-inbox.org/git/20181209230024.43444-3-carenas@gmail.com/
For the record, I read https://public-inbox.org/git/xmqqh8flkgs2.fsf@gitster-ct.c.googlers.com/ as encouraging a slightly more powerful argument in favor. Junio seemed to hope that PCRE2's own `pcre2grep` would behave that way, and that would give us plenty reason to just imitate it.
I don't know whether `pcre2grep` behaves that way, even if it does not, I think the benefits of the auto fallback to the end user are considerable.
Ciao, Dscho