[regex-coach] Feature request: Regexp performance indicator/steps used
Edi Weitz
edi at agharta.de
Mon May 2 20:28:32 UTC 2005
On Mon, 2 May 2005 16:05:46 +0200, Morten Hattesen <morten.hattesen at gmail.com> wrote:
> I really appreciate what Regex Coach has done for honing my Regular
> Expressions skills, and assisting debugging of complex expressions.
>
> I frequently wish to optimize regular expressions (mainly by
> reducing possible backtracking
> http://www.regular-expressions.info/atomic.html), but lack a way to
> test the relative performance between different regular expressions.
>
> To measure performance of a given regexp, I would really like the
> possibility of having Regex Coach count the total number of steps
> used by the underlying regexp engine for a given regexp search, or
> some other meaningful performance indicator.
>
> This could possibly be displayed when pressing the ">>" (show next
> match) button (regardless of whether a match was found or not). This
> way, you can quickly try out different matching approaches, and get
> an indication of the relative performance.
Hi Morten!
I see a couple of problems here:
1. As you mentioned yourself already the number of "steps" used is not
necessarily a good measure for the efficiency of a regular
expression.
2. The efficiency of a regular expression might depend heavily on the
target strings it's used with - a regex that's pretty good for a
certain subset of all possible strings might be particularly bad
for another subset.
3. Plus, the efficiency of a regular expression will also depend on
the underlying implementation - even if, say, Perl and PHP use the
same regex syntax they use different engines which employ different
optimization strategies.
Having said that, even if I had a good idea how to give performance
hints I wouldn't be able to add this to Regex Coach in the near future
because I'm very busy with other projects.
Cheers,
Edi.
More information about the regex-coach
mailing list