in reply to Re^3: Performance optimization question
in thread Performance optimization question
In general this is a really good idea, especially for regexes that might do some backtracking. In this case it won't happen, so it's not very exiting:
# perl 5.10.0 # match: Rate REGEX INDEX REGEX 87061/s -- -1% INDEX 87682/s 1% -- # fail: Rate REGEX INDEX REGEX 43840/s -- -1% INDEX 44246/s 1% --
Since the found text is in the middle it takes twice as long when there is no match.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Performance optimization question
by vit (Friar) on Apr 03, 2008 at 16:50 UTC |