Support the TailBench9000 benchmark in run-jsc-benchmarks
authorrmorisset@apple.com <rmorisset@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Oct 2017 16:58:57 +0000 (16:58 +0000)
committerrmorisset@apple.com <rmorisset@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Oct 2017 16:58:57 +0000 (16:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=178451

Reviewed by Saam Barati.

PerformanceTests:

The separation between the definition of the benchmarks (in merge-sort.js and n-body.js) and their loops (in *-run.js)
was causing trouble since the load of the js files only succeeded from the same directory. So I chose to merge them, following
the example of the other benchmarks.

* TailBench9000/merge-sort-run.js: Removed.
* TailBench9000/merge-sort.js:
* TailBench9000/n-body-run.js: Removed.
* TailBench9000/n-body.js:

Tools:

* Scripts/run-jsc-benchmarks:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223956 268f45cc-cd09-0410-ab3c-d52691b4dbfc

PerformanceTests/ChangeLog
PerformanceTests/TailBench9000/merge-sort-run.js [deleted file]
PerformanceTests/TailBench9000/merge-sort.js
PerformanceTests/TailBench9000/n-body-run.js [deleted file]
PerformanceTests/TailBench9000/n-body.js
Tools/ChangeLog
Tools/Scripts/run-jsc-benchmarks

index 20b2a44..101a925 100644 (file)
@@ -1,3 +1,19 @@
+2017-10-25  Robin Morisset  <rmorisset@apple.com>
+
+        Support the TailBench9000 benchmark in run-jsc-benchmarks
+        https://bugs.webkit.org/show_bug.cgi?id=178451
+
+        Reviewed by Saam Barati.
+
+        The separation between the definition of the benchmarks (in merge-sort.js and n-body.js) and their loops (in *-run.js)
+        was causing trouble since the load of the js files only succeeded from the same directory. So I chose to merge them, following
+        the example of the other benchmarks.
+
+        * TailBench9000/merge-sort-run.js: Removed.
+        * TailBench9000/merge-sort.js:
+        * TailBench9000/n-body-run.js: Removed.
+        * TailBench9000/n-body.js:
+
 2017-10-19  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         -Wsign-compare triggered by MallocBench
diff --git a/PerformanceTests/TailBench9000/merge-sort-run.js b/PerformanceTests/TailBench9000/merge-sort-run.js
deleted file mode 100644 (file)
index 30c7ee4..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-load("merge-sort.js");
-
-for (var i = 0; i < 3000; ++i)
-    TEST_mergeSort();
index 3725954..85835e7 100644 (file)
@@ -152,3 +152,6 @@ function TEST_mergeSort()
     
     test(0);
 }
+
+for (var i = 0; i < 3000; ++i)
+    TEST_mergeSort();
diff --git a/PerformanceTests/TailBench9000/n-body-run.js b/PerformanceTests/TailBench9000/n-body-run.js
deleted file mode 100644 (file)
index e957111..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-load("n-body.js");
-
-for (var i = 0; i < 300; ++i)
-    TEST_nBody();
index ace12ab..4c75b3d 100644 (file)
@@ -235,3 +235,6 @@ function TEST_nBody()
     if (ret != expected)
         throw "ERROR: bad result: expected " + expected + " but got " + ret;
 }
+
+for (var i = 0; i < 300; ++i)
+    TEST_nBody();
index 85f1987..a9f8f3e 100644 (file)
@@ -1,3 +1,12 @@
+2017-10-25  Robin Morisset  <rmorisset@apple.com>
+
+        Support the TailBench9000 benchmark in run-jsc-benchmarks
+        https://bugs.webkit.org/show_bug.cgi?id=178451
+
+        Reviewed by Saam Barati.
+
+        * Scripts/run-jsc-benchmarks:
+
 2017-10-25  Adrian Perez de Castro  <aperez@igalia.com>
 
         [WPE] Remove GLib API functions which use Cairo
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