in reply to Re^2: parsing a very large array with regexps
in thread parsing a very large array with regexps

I was going to suggest Regexp::Assemble as a way of producing an optimised regexp, but if even a single regexp takes too much time then that approach is not worth persuing.

If there is only a small population of sets of regexps used, then you should investigate caching (precomputing) the result sets of what different sets of regexp achieve when applied to the source list. Then, when you know that regexps A, B, D and G are called for, go and fetch the results that correspond to those regexps.

If the regexps are truly arbitrary, then you have little choice but to pay the full cost each time (possibly caching the result in case it is called for again later on).

• another intruder with the mooring in the heart of the Perl

  • Comment on Re^3: parsing a very large array with regexps