C:\test>213121.pl Iterations: 500 Length: 500 Enlil_2: 0.02351 sec/iteration found:208 Dingus_1: 0.01400 sec/iteration found:208 PhiRatE_2: 0.00987 sec/iteration found:208 Rasta_1: 0.05989 sec/iteration found:208 TommyW_1: 0.01516 sec/iteration found:208 Robartes_1: 0.01560 sec/iteration found:208 BrowserUk: 0.01186 sec/iteration found:208 Dingus_2: 0.01785 sec/iteration found:208 C:\test> #### #! perl -slw use strict; use Time::HiRes qw( gettimeofday tv_interval ); my $re = ''; $re .="(?:(?:(.)(?:\\$_*))|\$)" for 1 .. 500; $re = qr/$re/o; my $stn = "aaaaaaammm38fdkkkkkkkk3,,,,,,,,,,sad909999999994lkllllllllllllz" . ",,,,,,,,,dd888888882jk2kkd8d888d8djkjkjkjkkk3kk4k5kkkk65 "; for (1..2) { $stn.=$stn; } my $iterations = 500; print 'Iterations: ', $iterations; print 'Length: ', length($stn); for my $sub ( qw/Enlil_2 Dingus_1 PhiRatE_2 Rasta_1 TommyW_1 Robartes_1 BrowserUk Dingus_2/ ){ #! p_process_2/ ) { my $res; my $t0 = [gettimeofday]; for (1..$iterations) { no strict 'refs'; $res = &{$sub}($stn); } printf "%20s: %7.5f sec/iteration found:%3d\n", $sub, tv_interval( $t0 )/$iterations, scalar @$res; } sub BrowserUk { $_ = shift; my @c = m/$re/; $#c = $#- -1; return \@c; } sub Enlil_2 { $_ = shift; my @bah; while ( /((.)\2*)/g) { push (@bah, [$2,$-[1],$+[1] - $-[1]]); } return \@bah; } sub Dingus_1 { my $string = shift; my ($p, $c, $i, @res) = (0, substr($string,0,1)); for ($i=1; $i <<'END_OF_C_CODE'; void p_process_2(SV *svv) { char prev = 0; long count = 0; long i=0; long len = SvCUR(svv); AV *array; AV *list; char *s = SvPV(svv, len); Inline_Stack_Vars; Inline_Stack_Reset; list = newAV(); av_extend(list, 500); prev = *s; for (i=0; i