develooper Front page | perl.perl6.internals | Postings from July 2002

[perl #15425] Regex bugfix and speed-up

Thread Next
From:
Angel Faus
Date:
July 23, 2002 13:55
Subject:
[perl #15425] Regex bugfix and speed-up
Message ID:
rt-15425-31153.11.6951130934008@perl
# New Ticket Created by  Angel Faus 
# Please include the string:  [perl #15425]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=15425 >


Hi,

This patch does the following things:
  - it includes patch #15358, that tries to make the regex engine 
GC-safe

  - it fixes a bug on the rx engine, that caused the Intstack on 
rxinfo not to be ever freed.

As a result of this bugfix, very simple regular expressions get a 
noticable speed-up. 

For example, this is the data of matching the pattern /^zza/ against 
"zzabbbbbbbbbcdcdcdcdzz" 100.000 times, with the loop inside parrot 
(or perl5)

parrot, without the patch         12.834 seconds
parrot, with the patch               1.216 seconds

perl 5                                      0.21 seconds

This is of course not representative data, the speed-up is much 
smaller for the average regex. 

-àngel


-- attachment  1 ------------------------------------------------------
url: http://rt.perl.org/rt2/attach/31153/26111/ffdaea/perlreinfo.pmc

-- attachment  2 ------------------------------------------------------
url: http://rt.perl.org/rt2/attach/31153/26112/cf3c94/rx_patch.diff


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About