in reply to Re^2: regexp performance on large logfiles
in thread regexp performance on large logfiles

At least for those simplicistic patterns, you'll likely do much better if you just do a substring search. The regex engine will also do the substring search for you, but if you don't have www.*.info as valid pattern, using substr index could be faster. Even if you have such patterns, you can possibly move them towards the end of the checks so the rejection can happen earlier.

Update: I meant index...

Replies are listed 'Best First'.
Re^4: regexp performance on large logfiles
by snl_JYDawg (Initiate) on Aug 05, 2008 at 13:37 UTC
    current runtime: 25,4 minutes. just by re-examining the patterns and use as much index and substr as possible.
Re^4: regexp performance on large logfiles
by ikegami (Patriarch) on Aug 05, 2008 at 17:47 UTC
    Do you mean index? That shouldn't be any faster than a compiled regexp. The problem the OP has is that he's compiling his regexps over and over and over and over again.