in reply to Re^4: 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?
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.
|
|---|