From: Tim X Date: 2007-04-13T09:30:07+09:00 Subject: Re: Slow ruby regexes MenTaLguY writes: > On Thu, 12 Apr 2007 19:55:09 +0900, Tim X wrote: >> There is no point worrying about optimisation until you know there is a >> performance issue. For all you know, using the ruby RE engine for your >> task may fall well within your performance requirements. > > This is very, very true -- don't optimize until you measure. For the sake of the original poster, I want to underscore this point. Chances are the Ruby regexp engine is way more than adequate for his purposes. > >> The algorithm used by Perl et. al. may not be fast compared to the >> alternative, but it is relatively simple. As important to performance is correctness. > > Perl's implementation is not very simple, however... > True, but I think thats due to all the additional add-ons. The basic underlying algorithm is/was fairly straight forward. However, I think even the perl developers have realised that Perl's RE support was getting out of hand. Although I've not looked at it, I believe there is significant changes in perl 6 in this area. I seem to remember reading something from Larry, where he said that Perl's functionality in this area has extended to the point that in reality, you probably couldn't call it regexps anymore, but as that was the terminology people were use to, thats what it wold be known as. Perl has gone past what was traditionally defined as regexps. Tim -- tcross (at) rapttech dot com dot au