]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/test/perf/perldriver/PerfFramework.pm
ICU-400.37.tar.gz
[apple/icu.git] / icuSources / test / perf / perldriver / PerfFramework.pm
index 2540e920a8842a8b40fd85ed7ed8ba736e7ec427..96ba82c0e729a436c137354e13fa2aa1d73aca6a 100644 (file)
@@ -1,9 +1,9 @@
 #!/usr/local/bin/perl
-#  ********************************************************************
+#  ***********************************************************************
 #  * COPYRIGHT:
-#  * Copyright (c) 2002, International Business Machines Corporation and
-#  * others. All Rights Reserved.
-#  ********************************************************************
+#  * Copyright (c) 2002-2008, 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 {
@@ -39,6 +40,11 @@ sub setupOptions {
   if($options{"dataDir"}) {
     $DATADIR = $options{"dataDir"};
   }
+  
+  # Added by Doug
+  if ($options{"iterations"}) {
+       $ITERATIONS = $options{"iterations"};
+  }
 }
 
 sub runTests {
@@ -113,7 +119,13 @@ sub compareLoop {
     # 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";
+      #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);
@@ -294,7 +306,7 @@ sub callProg {
         }
 
         else {
-            die "Can't parse: $_";
+            die "Can't parse: $_";
         }
     }