Help for this page

Select Code to Download


  1. or download this
            'ROBO' => sub {
                my $i = @array;
    ...
          ROBO: 19 wallclock secs (18.59 usr +  0.00 sys = 18.59 CPU) @ 26
    +.90/s (n=500)
       WITHOUT: 15 wallclock secs (15.69 usr +  0.00 sys = 15.69 CPU) @ 31
    +.87/s (n=500)
    5000000, 5250000, 5000000, 5125250
    
  2. or download this
            'ROBO' => sub {
                my $i = @array;
                do {
    ...
                    @array[$i,$j] = @array[$j,$i];
                } while (--$i);
            },
    
  3. or download this
    roboticus@sparky:~$ perl 1088227.pl 
    Benchmark: timing 500 iterations of BRANCH, IFIDDLE, ROBO, WITHOUT...
    ...
          ROBO:  8 wallclock secs ( 7.85 usr +  0.00 sys =  7.85 CPU) @ 63
    +.69/s (n=500)
       WITHOUT: 15 wallclock secs (15.33 usr +  0.00 sys = 15.33 CPU) @ 32
    +.62/s (n=500)
    roboticus@sparky:~$