X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/b75a7d8f3b4adbae880cab104ce2c6a50eee4db2..ef6cf650f4a75c3f97de06b51fa104f2069b9ea2:/icuSources/test/perf/perldriver/PerfFramework.pm?ds=inline
diff --git a/icuSources/test/perf/perldriver/PerfFramework.pm b/icuSources/test/perf/perldriver/PerfFramework.pm
index 2540e920..99c48e6e 100644
--- a/icuSources/test/perf/perldriver/PerfFramework.pm
+++ b/icuSources/test/perf/perldriver/PerfFramework.pm
@@ -1,9 +1,9 @@
#!/usr/local/bin/perl
-# ********************************************************************
+# ***********************************************************************
# * COPYRIGHT:
-# * Copyright (c) 2002, International Business Machines Corporation and
-# * others. All Rights Reserved.
-# ********************************************************************
+# * Copyright (c) 2002-2013, International Business Machines Corporation
+# * and others. All Rights Reserved.
+# ***********************************************************************
use strict;
@@ -23,6 +23,7 @@ my $extraArgs; # stuff that always gets passed to the test program
my $iterCount = 0;
my $NUMPASSES = 4;
my $TIME = 2;
+my $ITERATIONS; #Added by Doug
my $DATADIR;
sub setupOptions {
@@ -35,10 +36,15 @@ sub setupOptions {
if($options{"passes"}) {
$NUMPASSES = $options{"passes"};
}
-
+
if($options{"dataDir"}) {
$DATADIR = $options{"dataDir"};
}
+
+ # Added by Doug
+ if ($options{"iterations"}) {
+ $ITERATIONS = $options{"iterations"};
+ }
}
sub runTests {
@@ -62,19 +68,19 @@ sub runTests {
if (%datafiles) {
foreach $locale (sort keys %datafiles ) {
foreach $data (@{ $datafiles{$locale} }) {
- closeTable;
- my $locdata = "";
- if(!($locale eq "")) {
- $locdata = "Locale: $locale
";
- }
- $locdata .= "Datafile: $data
";
- startTest($locdata);
-
- if($DATADIR) {
- compareLoop ($tests, $locale, $DATADIR."/".$data);
- } else {
- compareLoop ($tests, $locale, $data);
- }
+ closeTable;
+ my $locdata = "";
+ if(!($locale eq "")) {
+ $locdata = "Locale: $locale
";
+ }
+ $locdata .= "Datafile: $data
";
+ startTest($locdata);
+
+ if($DATADIR) {
+ compareLoop ($tests, $locale, $DATADIR."/".$data);
+ } else {
+ compareLoop ($tests, $locale, $data);
+ }
}
}
} else {
@@ -91,12 +97,12 @@ sub compareLoop {
my $datafile = shift;
my $locAndData = "";
if($locale) {
- $locAndData .= " -L $locale";
+ $locAndData .= " -L \"$locale\"";
}
if($datafile) {
$locAndData .= " -f $datafile";
}
-
+
my $args;
my ($i, $j, $aref);
foreach $i ( sort keys %tests ) {
@@ -112,8 +118,14 @@ sub compareLoop {
for $j ( 0 .. $#{$aref} ) {
# first we calibrate. Use time from somewhere
# first test is used for calibration
- ($program, @argsAndTest) = split(/\ /, @{ $tests{$i} }[$j]);
- my $commandLine = "$program -t $TIME -p $NUMPASSES $locAndData @argsAndTest";
+ ($program, @argsAndTest) = split(/,/, @{ $tests{$i} }[$j]);
+ #Modified by Doug
+ my $commandLine;
+ if ($ITERATIONS) {
+ $commandLine = "$program -i $ITERATIONS -p $NUMPASSES $locAndData @argsAndTest";
+ } else {
+ $commandLine = "$program -t $TIME -p $NUMPASSES $locAndData @argsAndTest";
+ }
#my $commandLine = "$program -i 5 -p $NUMPASSES $locAndData @argsAndTest";
my @res = measure1($commandLine);
store("$i, $program @argsAndTest", @res);
@@ -122,9 +134,8 @@ sub compareLoop {
push(@noopers, shift(@res));
my @data = @{ shift(@res) };
if($#res >= 0) {
- push(@noevents, shift(@res));
- }
-
+ push(@noevents, shift(@res));
+ }
shift(@data) if (@data > 1); # discard first run
@@ -294,7 +305,7 @@ sub callProg {
}
else {
- die "Can't parse: $_";
+ # die "Can't parse: $_";
}
}