Support the TailBench9000 benchmark in run-jsc-benchmarks
[WebKit-https.git] / Tools / Scripts / run-jsc-benchmarks
index acfe87b..c34f1cb 100755 (executable)
@@ -48,6 +48,7 @@ PERFORMANCETESTS_PATH = OPENSOURCE_PATH + "PerformanceTests"
 SUNSPIDER_PATH = PERFORMANCETESTS_PATH + "SunSpider" + "tests" + "sunspider-1.0"
 LONGSPIDER_PATH = PERFORMANCETESTS_PATH + "LongSpider"
 V8_PATH = PERFORMANCETESTS_PATH + "SunSpider" + "tests" + "v8-v6"
+TAILBENCH_PATH = PERFORMANCETESTS_PATH + "TailBench9000"
 MICROBENCHMARKS_PATH = OPENSOURCE_PATH + "JSTests" + "microbenchmarks"
 OCTANE_WRAPPER_PATH = PERFORMANCETESTS_PATH + "Octane" + "wrappers"
 JSBENCH_PATH = PERFORMANCETESTS_PATH + "JSBench"
@@ -226,6 +227,7 @@ $includeBrowsermarkDOM=false
 $includeOctane=true
 $includeCompressionBench = true
 $includeSixSpeed = true
+$includeTailBench = true
 $measureGC=false
 $benchmarkPattern=nil
 $verbosity=0
@@ -317,6 +319,7 @@ def usage
   puts "--browsermark-js     Only run browsermark-js."
   puts "--browsermark-dom    Only run browsermark-dom."
   puts "--octane             Only run Octane."
+  puts "--tail-bench         Only run TailBench"
   puts "--compression-bench  Only run compression bench"
   puts "                     The default is to run all benchmarks. The above options can"
   puts "                     be combined to run any subset (so --sunspider --dsp will run"
@@ -1624,6 +1627,18 @@ class JSBenchBenchmark
   end
 end
 
+class TailBenchBenchmark
+  include Benchmark
+
+  def initialize(name)
+    @name = name
+  end
+
+  def emitRunCode(plan)
+    emitBenchRunCode(fullname, plan, SingleFileTimedBenchmarkParameters.new(ensureFile("TailBench-#{@name}", "#{TAILBENCH_PATH}/#{@name}.js")))
+  end
+end
+
 class MicrobenchmarksBenchmark
   include Benchmark
   
@@ -2671,6 +2686,7 @@ begin
       $includeOctane = false
       $includeCompressionBench = false
       $includeSixSpeed = false
+      $includeTailBench = false;
       $sawBenchOptions = true
     end
   end
@@ -2696,6 +2712,7 @@ begin
                  ['--octane', GetoptLong::NO_ARGUMENT],
                  ['--compression-bench', GetoptLong::NO_ARGUMENT],
                  ['--six-speed', GetoptLong::NO_ARGUMENT],
+                 ['--tail-bench', GetoptLong::NO_ARGUMENT],
                  ['--benchmarks', GetoptLong::REQUIRED_ARGUMENT],
                  ['--measure-gc', GetoptLong::OPTIONAL_ARGUMENT],
                  ['--force-vm-kind', GetoptLong::REQUIRED_ARGUMENT],
@@ -2775,6 +2792,9 @@ begin
     when '--js-bench'
       resetBenchOptionsIfNecessary
       $includeJSBench = true
+    when '--tail-bench'
+      resetBenchOptionsIfNecessary
+      $includeTailBench = true
     when '--microbenchmarks'
       resetBenchOptionsIfNecessary
       $includeMicrobenchmarks = true
@@ -3015,7 +3035,13 @@ begin
     | nameAndMode |
     JSBENCH.add JSBenchBenchmark.new(*nameAndMode)
   }
-  
+
+  TAILBENCH = BenchmarkSuite.new("TailBench", :geometricMean, 0)
+  ["n-body", "merge-sort"].each {
+    | name |
+    TAILBENCH.add TailBenchBenchmark.new(name);
+  }
+
   MICROBENCHMARKS = BenchmarkSuite.new("Microbenchmarks", :geometricMean, 0)
   Dir.foreach(MICROBENCHMARKS_PATH) {
     | filename |
@@ -3154,10 +3180,14 @@ begin
     end
   end
   
+  if $includeTailBench and not TAILBENCH.empty?
+    $suites << TAILBENCH
+  end
+
   if $includeMicrobenchmarks and not MICROBENCHMARKS.empty?
     $suites << MICROBENCHMARKS
   end
-  
+
   if $includeAsmBench and not ASMBENCH.empty?
     if ASMBENCH_PATH
       $suites << ASMBENCH