run-jsc-benchmarks should only report preferred mean
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Mar 2015 22:46:56 +0000 (22:46 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Mar 2015 22:46:56 +0000 (22:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=142874

Reviewed by Geoffrey Garen.

Just collect statistics for the preferred mean.

* Scripts/run-jsc-benchmarks:

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

Tools/ChangeLog
Tools/Scripts/run-jsc-benchmarks

index 17698caa81a410ced7295f40857510cfd33ada65..abfe88a70f7e16260d59101d45eab8056934c32c 100644 (file)
@@ -1,3 +1,14 @@
+2015-03-19  Ryosuke Niwa  <rniwa@webkit.org>
+
+        run-jsc-benchmarks should only report preferred mean
+        https://bugs.webkit.org/show_bug.cgi?id=142874
+
+        Reviewed by Geoffrey Garen.
+
+        Just collect statistics for the preferred mean.
+
+        * Scripts/run-jsc-benchmarks:
+
 2015-03-19  Alex Christensen  <achristensen@webkit.org>
 
         [Content Extensions] Test regular expression parse failures.
index fbaa4724d3bb405ecb1a50a719c7aaf78ac4abfe..ddf661667d9a1c25d7d67b32acd192cf1d799588 100755 (executable)
@@ -2471,7 +2471,7 @@ def parseAndDisplayResults(results)
     outp.puts createVMsString
   end
   
-  def summaryStats(outp, json, jsonKey, accumulators, name, decimalShift, &proc)
+  def summaryStats(outp, json, accumulators, name, decimalShift, &proc)
     resultingJson = {}
     outp.print "   " if $allSuites.size > 1
     outp.print rpad(name, $benchpad + $weightpad)
@@ -2488,31 +2488,14 @@ def parseAndDisplayResults(results)
       outp.print("    "+accumulators[-1].stats(&proc).compareTo(accumulators[0].stats(&proc)).longForm)
     end
     outp.puts
-    json[jsonKey] = resultingJson
+    json[name] = resultingJson
   end
-  
-  def meanName(currentMean, preferredMean)
-    result = "<#{currentMean}>"
-    if "#{currentMean}Mean" == preferredMean.to_s
-      result += " *"
-    end
-    result
-  end
-  
+
   def allSummaryStats(outp, json, accumulators, preferredMean, decimalShift)
-    summaryStats(outp, json, "<arithmetic>", accumulators, meanName("arithmetic", preferredMean), decimalShift) {
-      | stat |
-      stat.arithmeticMean
-    }
-    
-    summaryStats(outp, json, "<geometric>", accumulators, meanName("geometric", preferredMean), decimalShift) {
-      | stat |
-      stat.geometricMean
-    }
-    
-    summaryStats(outp, json, "<harmonic>", accumulators, meanName("harmonic", preferredMean), decimalShift) {
+    meanLabel = '<' + preferredMean.to_s.sub(/Mean$/, '') + '>'
+    summaryStats(outp, json, accumulators, meanLabel, decimalShift) {
       | stat |
-      stat.harmonicMean
+      stat.send(preferredMean)
     }
   end