in reply to Re^3: Hypothesis: some magic string optimalization in perl kills my server from time to time
in thread Hypothesis: some magic string optimalization in perl kills my server from time to time
The program doesn't stop at any of regexpes. It finishes computations sucessfully, but sometimes it takes quite short, and sometimes it takes very long.
For example on 2Mb of data, when I call "list_extr" like this:
list_extr(\( "(" . $big_string . ")" ));
it takes only half a second. But if I call like this:
it takes 20 seconds (slower 40x times). Why? Both ways look the same -- make string with parentheses around old string, take reference to it, do same computations. So if they are the same why the difference in time? I think perl is doing some magic here, but only someone more expierenced would tell.my $ttt = "(" . $big_string . ")"; list_extr(\$ttt);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Hypothesis: some magic string optimalization in perl kills my server from time to time
by tybalt89 (Monsignor) on Sep 30, 2016 at 15:50 UTC |