Perhaps you did unanchored searching? That's one case the Regexp module doesn't handle well. E.g. this
Regexp ("foo")->match (buf);
is a lot slower than
Regexp ("^.*(foo)")->match (buf);
Both Perl and PCRE can handle that much better.
/ Martin Stjernholm, Roxen IS
Previous text:
2003-09-19 23:28: Subject: Re: Adding PCRE to Pike
On Fri, Sep 19, 2003 at 03:50:07PM +0200, Johan Sundstr?m, Lysator @ Pike developers forum wrote:
Those tests are very artifical. Long time ago I made a benchmark on real-life data (squid logs) with real-life patterns (URL matching), using both Pike REs and PCRE (my module). It shows that PCRE is at least 2x faster (PCRE 3.5 if I remember correctly, now we have 4.2).
The app is at: http://aldem.net/pike/re-bench.pike, the data were my squid logs. Exact results were published somewhere in January this year.
Even taking into account that squid logs (and logs in general) processing isn't majority of tasks, the experiment shows that in case of _complex_ patterns and huge amounts of data Pike REs slow enough.
Just to note - Perl has one of the slowest RE engines (however, very powerful), so no wonder that Pike outperforms Perl in this (trading features for speed).
Regards, /Al
/ Brevbäraren