From morten.hattesen at gmail.com Mon May 2 14:05:46 2005 From: morten.hattesen at gmail.com (Morten Hattesen) Date: Mon, 2 May 2005 16:05:46 +0200 Subject: [regex-coach] Feature request: Regexp performance indicator/steps used Message-ID: <5780f10205050207056e99bdbf@mail.gmail.com> 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. Rgds, Morten Hattesen -------------- next part -------------- An HTML attachment was scrubbed... URL: From edi at agharta.de Mon May 2 20:28:32 2005 From: edi at agharta.de (Edi Weitz) Date: Mon, 02 May 2005 22:28:32 +0200 Subject: [regex-coach] Feature request: Regexp performance indicator/steps used In-Reply-To: <5780f10205050207056e99bdbf@mail.gmail.com> (Morten Hattesen's message of "Mon, 2 May 2005 16:05:46 +0200") References: <5780f10205050207056e99bdbf@mail.gmail.com> Message-ID: On Mon, 2 May 2005 16:05:46 +0200, Morten Hattesen 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. From morten.hattesen at gmail.com Tue May 3 07:04:58 2005 From: morten.hattesen at gmail.com (Morten Hattesen) Date: Tue, 3 May 2005 09:04:58 +0200 Subject: [regex-coach] Feature request: Regexp performance indicator/steps used In-Reply-To: References: <5780f10205050207056e99bdbf@mail.gmail.com> Message-ID: <5780f1020505030004554b56b5@mail.gmail.com> I realize that a "step count" is not necessarily a true indication of performance of a regular expression, but it would be a valuable tool, and could provide valid performance indication when comparing two different regular expression approaches on a given target string. I hope you'll keep it in mind, when you get around to extending/maintaining Regex Coach some time in the future. rgds, Morten On 5/2/05, Edi Weitz wrote: > > 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. > -- Morten Hattesen Almindingen 56 DK-2870 Dyssegaard Denmark Tel: +45 3969 2212 Mobile: +45 2524 2114 mailto:morten.hattesen at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: