Regex JIT?

BlitzMax Forums/Brucey's Modules/Regex JIT?

Yasha(Posted 2015) [#1]
The SVN version (not the download version?) of the regex module seems to include the PCRE JIT engine.

Is it enabled by default/at all? If not, how can one turn it on?

I tried simply replacing the download module with the SVN one, and my program's performance was 20% worse, which presumably means either the JIT isn't working, or something's triggering pathological recompilation behaviour.

(I currently don't know anything at all about PCRE's source, internals, or how to configure it for BlitzMax, only that the program's running slowly and ~95% of its time is spent inside PCRE this is no longer causing a problem for me, but still seems like a useful question)


Brucey(Posted 2015) [#2]
The SVN version (not the download version?)

In their wisdom, google have removed the ability to add new downloads on googlecode. Everyone else who use googlecode have been in the same boat, so a lot of people have been migrating away... ho hum.

The latest, latest version (v10.00 / pcre2 / Jan 2015) is up now.

I've added some new JIT options to TRegExOptions, which, if enabled, will utilise the JIT compiler.
I've re-written TRegExMatch, so instead of caching all the sub expressions in arrays, it fetches them direct from pcre as required, which may (or may not) help improve performance.

I haven't actually tested the JIT stuff yet though, so YMMV ;-)


Yasha(Posted 2015) [#3]
Thank you! That should be a big help to certain programs going forward.

(Sorry I forgot to check back here; the solution to my own immediate problem was rather simpler: don't invoke regex to compare what you know in advance will be completely flat strings!)