http://www.bagley.org/~doug/shootout/bench/regexmatch/?cpu
/ Johan Sundström, Lysator
Previous text:
2003-09-19 15:30: Subject: Re: Adding PCRE to Pike
where did you see that?
greetings, martin.
/ Brevbäraren
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
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
On Sat, Sep 20, 2003 at 12:20:01AM +0200, Martin Stjernholm, Roxen IS @ Pike developers forum wrote:
Perhaps you did unanchored searching? That's one case the Regexp module doesn't handle well. E.g. this
No, is anchored. You can look at the app :) It is just a bit complex
It is not my full version of URL matching, though - but standard Pike's Regexp lack some features, so I tried to make it compatible.
Regards, /Al
pike-devel@lists.lysator.liu.se