in reply to Parse::RecDescent and perlcc ?
The reason is that P::RD performs the equivalent of:
And it does this for everything, over and over again. This "nibbling" approach is great for short strings, but for long strings, there's a whole lot of string copying going on.s/^$syntax_I_recognize// && do { &Action_for_syntax };
theDamian said that a significant speedup would have been realized by changing these to:
and letting pos() walk through the string, but alas never got the time to change P::RD into Parse::FastDecent (this would have been the basic change)./\G$syntax_I_recognize/gc && do { &Action_for_syntax };
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: •Re: Parse::RecDescent and perlcc ?
by bear_hwn (Acolyte) on May 29, 2003 at 19:16 UTC | |
by bear_hwn (Acolyte) on May 30, 2003 at 22:07 UTC |