On Monday, April 22, 2002, at 03:43 , Alfred Vahau wrote:

> Assuming that the array has been converted to a scalar, then the
> following "Lookaround Assertion" works:
>
> #!/usr/bin/perl
>
> $_ = 'a a a b b c c';
>
> 1 while s/\b(\w+) \s (?= \1\b ) //gxi;
> print $_, "\n";

Survey Says:

Benchmark: timing 20000 iterations of Boink, Faq, Mine...
      Boink: 19 wallclock secs (18.58 usr +  0.00 sys = 18.58 CPU) @ 
1076.43/s (n=20000)
        Faq: 33 wallclock secs (31.72 usr +  0.00 sys = 31.72 CPU) @ 630.52/
s (n=20000)
       Mine:  3 wallclock secs ( 3.74 usr +  0.00 sys =  3.74 CPU) @ 
5347.59/s (n=20000)

upgrading jenda's original benchmark test so that we do not
return the scalar in his, but do buy the conversion from
an array to a scalar.....

assuming that it was in the scalar context the benchmark is:

Benchmark: timing 20000 iterations of Boink, Faq, Mine...
      Boink: 17 wallclock secs (15.70 usr +  0.00 sys = 15.70 CPU) @ 
1273.89/s (n=20000)




ciao
drieux

---


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to