in reply to 5.10.0 regex slowdown
I suspect that what is happening is that perl is building multiple trie objects and then executing each in turn, because the sizeof the jump offset is insufficient to jump further than 128 k forward. It highly likely that i didnt spend enough time on handling this case and some further work would improve it. I havent actually run the code to inspect the output of re=debug and i suspect its too long to post. Ill try to get it run sometime soon.
Regarding RE_MAXBUF, what that does is set a threshold over which perl will switch to a slower and less efficient construction algorithm. If its set to 0 it disables the trie optimisation outright, but it has to be set before the pattern is compiled, in a BEGIN for instance.
$world=~s/war/peace/g
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: 5.10.0 regex slowdown
by BrowserUk (Patriarch) on Feb 21, 2008 at 11:20 UTC | |
by demerphq (Chancellor) on Feb 21, 2008 at 11:34 UTC | |
by BrowserUk (Patriarch) on Feb 21, 2008 at 12:21 UTC | |
by shmem (Chancellor) on Feb 21, 2008 at 13:00 UTC |