Next Making Programs Faster 79

Devel::OurProf

     END {  # Print out the report
       select REPORT;
       my @r;
       my @line_ranks = sort {$time[$b] <=> $time[$a]} (1 .. $#time);
       @r[@line_ranks] = (('*') x 10, ('+') x 15, ('-') x 75, ('.') x 150);
       for (1 .. $#count) {
         my ($c, $t) = ($count[$_], $time[$_]);
         my $L = ${"::_<Pod/Parser.pm"}[$_];
         chomp $L;
         $L = substr($L, 0, 54);
         if ($c) {
             printf "%4d%s%6d %5.2f %5.2f %-54s\n",
               $_, $r[$_] || ' ', $c, $t, 100*$t/$total_time, $L;
         } else {
             printf "%4d                    %-54s\n", $_, $L;
         }
       }
     }

Next Copyright © 2003 M. J. Dominus