in reply to Is this apples vs oranges? (was Re^6: Perl regexp matching is slow??)
in thread Perl regexp matching is slow??

You're right. I am timing entire programs.

But I am timing one program running enough iterations of the match to take 10 seconds worth of CPU time, up to a max of 10,000 iterations. If you assume Perl starts in less than 10ms (it loads in well under that on my machine), then the extra time added by startup is no more than 1 microsecond in the final numbers. Also, the point was really the difference in growth rates: the 60+ seconds for backtracking isn't being spent during program load. (And PCRE is a C program too.)
  • Comment on Re: Is this apples vs oranges? (was Re^6: Perl regexp matching is slow??)

Replies are listed 'Best First'.
Re^2: Is this apples vs oranges? (was Re^6: Perl regexp matching is slow??)
by xdg (Monsignor) on Feb 05, 2007 at 12:23 UTC

    Fair point. I missed the number of iterations in my quick scan through the code (more descriptive variable names would have helped). My question didn't relate to the 60+ second range but the fraction of a second range, since it looked in the large graph as if your special-purpose code had a near-order-of-magnitude "head start" over the average general purpose tool examined.

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.