Renamed XLarge* => Large*
[WebKit-https.git] / PerformanceTests / MallocBench / run-malloc-benchmarks
index 0b98b725e8d65886e770de5037ef6d4690394759..e57a4dbc18a024d0107dba482ab9945110593913 100755 (executable)
@@ -6,54 +6,34 @@ require 'pathname'
 $binDir = "#{File.expand_path(File.dirname(__FILE__))}"
 $productDir = `perl -e 'use lib \"#{$binDir}/../../Tools/Scripts\"; use webkitdirs; print productDir()'`
 
-$benchmarks = [
-    # Single-threaded benchmarks.
-    "churn",
-    "list_allocate",
-    "tree_allocate",
-    "tree_churn",
-    "fragment",
-    "fragment_iterate",
-    "medium",
-    "big",
-
-    # Benchmarks based on browser recordings.
-    "facebook",
-    "reddit",
-    "flickr",
-    "theverge",
-    "nimlang",
-
-    # Multi-threaded benchmark variants.
+$benchmarks_all = [
     "message_one",
     "message_many",
     "churn --parallel",
     "list_allocate --parallel",
     "tree_allocate --parallel",
     "tree_churn --parallel",
-    # "facebook --parallel",
-    # "reddit --parallel",
-    # "flickr --parallel",
-    # "theverge --parallel",
-    # "nimlang --use-thread-id",
-    "fragment --parallel",
-    "fragment_iterate --parallel",
-
-    # These tests often crash TCMalloc: <rdar://problem/13657137>.
-    "medium --parallel",
-    "big --parallel",
-
-    # Enable these tests to test memory footprint. The way they run is not
-    # really compatible with throughput testing.
-    # "reddit_memory_warning --runs 0",
-    # "flickr_memory_warning --runs 0",
-    # "theverge_memory_warning --runs 0",
-
-    # Enable this test to test shrinking back down from a large heap while a process remains active.
-    # The way it runs is not really compatible with throughput testing.
-    # "balloon"
+    "facebook --parallel",
+    "reddit --parallel",
+    "flickr --parallel",
+    "theverge --parallel",
+]
+
+$benchmarks_memory = [
+    "facebook",
+    "reddit",
+    "flickr",
+    "theverge",
+    "nimlang"
+]
+
+$benchmarks_memory_warning = [
+    "reddit_memory_warning --runs 0",
+    "flickr_memory_warning --runs 0",
+    "theverge_memory_warning --runs 0",
 ]
 
+$benchmarks = $benchmarks_all
 $heap = 0
 
 def usage
@@ -198,6 +178,8 @@ end
 def parseOptions
     GetoptLong.new(
         ['--benchmark', GetoptLong::REQUIRED_ARGUMENT],
+        ['--memory', GetoptLong::NO_ARGUMENT],
+        ['--memory_warning', GetoptLong::NO_ARGUMENT],
         ['--heap', GetoptLong::REQUIRED_ARGUMENT],
         ['--help', GetoptLong::NO_ARGUMENT],
     ).each {
@@ -205,6 +187,10 @@ def parseOptions
         case opt
         when '--benchmark'
             $benchmarks = [ arg ]
+        when '--memory'
+            $benchmarks = $benchmarks_memory
+        when '--memory_warning'
+            $benchmarks = $benchmarks_memory_warning
         when '--heap'
             $heap = arg
         when '--help'
@@ -274,8 +260,8 @@ def runBenchmarks(dylibs)
             splitOutput = output.split("\n")
 
             executionTime[-1].push(TimeStat.new(benchmark, splitOutput[1]))
-            peakMemory[-1].push(PeakMemoryStat.new(benchmark, splitOutput.length > 3 ? splitOutput[3] : "0"))
-            memoryAtEnd[-1].push(MemoryStat.new(benchmark, splitOutput.length > 2 ? splitOutput[2] : "0"))
+            peakMemory[-1].push(PeakMemoryStat.new(benchmark, splitOutput.length > 3 ? splitOutput[2] : "0"))
+            memoryAtEnd[-1].push(MemoryStat.new(benchmark, splitOutput.length > 2 ? splitOutput[3] : "0"))
         }
     }
     $stderr.print "\r                                                                                \n"