in reply to Re^3: How to speed up multiple regex in a loop for a big data?
in thread How to speed up multiple regex in a loop for a big data?

I guess I am naive. However, I am not sure how your code can speed up things much. I have a wild thought though. Is there any way I can compile Perl code to make it a bin excutable which could be dramatically faster to run...?
  • Comment on Re^4: How to speed up multiple regex in a loop for a big data?

Replies are listed 'Best First'.
Re^5: How to speed up multiple regex in a loop for a big data?
by salva (Canon) on May 25, 2006 at 16:58 UTC
    I am not sure how your code can speed up things much

    well, the bottleneck in the OP code was probably the regular expresion being compiled over and over because he was using a variable ($key) inside. On my code, regexps are just compiled once so it should be much faster.

    You could also use the qr operator to precompile them, but expanding the loop should give some additional speed as you can see from the benchmarks.

    Is there any way I can compile...

    No.