Help for this page

Select Code to Download


  1. or download this
    sub both_at_once {
        my $data = $testdata;
    ...
        $data =~ s/(^\s*|\s*$)//g;
        return $data;
    }
    
  2. or download this
    Benchmark: timing 100000 iterations of both_at_once, both_at_once2, do
    +tstar, first_n_last_1, first_n_last_2...
    both_at_once: 10 wallclock secs ( 9.04 usr +  0.00 sys =  9.04 CPU) @ 
    +11061.95/s (n=100000)
    ...
       dotstar:  9 wallclock secs ( 8.30 usr +  0.00 sys =  8.30 CPU) @ 12
    +048.19/s (n=100000)
    first_n_last_1:  6 wallclock secs ( 5.77 usr +  0.00 sys =  5.77 CPU) 
    +@ 17331.02/s (n=100000)
    first_n_last_2:  2 wallclock secs ( 2.31 usr +  0.00 sys =  2.31 CPU) 
    +@ 43290.04/s (n=100000)