cvsuser 05/04/08 12:14:57
Modified: tools/dev parrotbench.pl Log: Applied patch from http://rt.perl.org/rt3/Ticket/Display.html?id=33642, as Jashua Gatcomp said: Apply away. Revision Changes Path 1.6 +3 -17 parrot/tools/dev/parrotbench.pl Index: parrotbench.pl =================================================================== RCS file: /cvs/public/parrot/tools/dev/parrotbench.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- parrotbench.pl 27 Aug 2004 13:03:53 -0000 1.5 +++ parrotbench.pl 8 Apr 2005 19:14:56 -0000 1.6 @@ -154,20 +154,6 @@ @{ $cfg{skip_bench} } = @regexes ? @regexes : '[^\d\D]'; } -# Move to the benchmark directory -if ( defined $cfg{bench_path} ) { - chdir $cfg{bench_path} or die "Unable to cd to $cfg{bench_path}"; -} -else { - chdir $FindBin::Bin or die "Unable to cd to directory of $0"; - chdir File::Spec->catdir( - File::Spec->updir, - File::Spec->updir, - 'examples', - 'benchmarks' - ) or die "Unable to find the benchmark directory"; -} - # Frequently Used Variables my %bench; my @section = sort $ini->GroupMembers( 'benchmark' ); @@ -197,7 +183,7 @@ next if ! $ext; $bench{ $name }{ $program[ $index ] } = $ext; } -}, File::Spec->curdir(); +}, $cfg{bench_path}; die "No benchmarks found" if ! keys %bench; # List Names Of Benchmarks With Pretty Output @@ -227,7 +213,7 @@ } if ( $cfg{use_times} ) { my $type = $cfg{method} == 1 ? 'CPU' : 'wall-clock'; - print "Times are in $type seconds. (lower is better\n"; + print "Times are in $type seconds. (lower is better)\n"; } else { print "Numbers are relative to the first one. (lower is better)\n"; @@ -253,7 +239,7 @@ if ( $bench{ $name }{ $prog } ) { my $start = $Get_Time{ $cfg{method} }->(); system( - $ini->val($sect, 'exe') . " " . $name . $bench{$name}{$prog} + $ini->val($sect, 'exe') . " " . File::Spec->catdir( $cfg{bench_path}, $name . $bench{$name}{$prog}) ); my $stop = $Get_Time{ $cfg{method} }->(); my $used = $stop - $start;
