<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[167511] trunk/PerformanceTests</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/167511">167511</a></dd>
<dt>Author</dt> <dd>ggaren@apple.com</dd>
<dt>Date</dt> <dd>2014-04-18 15:31:34 -0700 (Fri, 18 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Added some more Membuster recordings to MallocBench
https://bugs.webkit.org/show_bug.cgi?id=131862

Reviewed by Sam Weinig.

* MallocBench/MallocBench/Benchmark.cpp:
(Benchmark::Benchmark):
(Benchmark::run):
* MallocBench/MallocBench/Benchmark.h:
* MallocBench/MallocBench/CommandLine.cpp:
* MallocBench/MallocBench/CommandLine.h:
(CommandLine::runs): Added a --runs option, so we can specify zero runs
for memory warning benchmarks. Those benchmarks want zero runs so that
they can perform a single warmup, which does not free all allocated
objects, and then see how far back to 0MB they can get. Running multiple
times would accumulate leaks, which is not representative of the
simulated scenario.

* MallocBench/MallocBench/Interpreter.cpp:
(Interpreter::Interpreter):
(Interpreter::run):
* MallocBench/MallocBench/Interpreter.h: Support not deallocating all
objects allocated during the recording, so we can do low memory warning
memory use measurements, as above.

* MallocBench/MallocBench/flickr.cpp:
(benchmark_flickr_memory_warning):
* MallocBench/MallocBench/main.cpp:
(main):
* MallocBench/MallocBench/reddit.cpp:
(benchmark_reddit_memory_warning):
* MallocBench/MallocBench/theverge.cpp:
(benchmark_theverge_memory_warning): Adopt the API above.

* MallocBench/run-malloc-benchmarks: I took a first pass at listing all
available benchmarks here. Then I commented out the benchmarks that
probably aren't reasonable to run by default.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkPerformanceTestsChangeLog">trunk/PerformanceTests/ChangeLog</a></li>
<li><a href="#trunkPerformanceTestsMallocBenchMallocBenchBenchmarkcpp">trunk/PerformanceTests/MallocBench/MallocBench/Benchmark.cpp</a></li>
<li><a href="#trunkPerformanceTestsMallocBenchMallocBenchBenchmarkh">trunk/PerformanceTests/MallocBench/MallocBench/Benchmark.h</a></li>
<li><a href="#trunkPerformanceTestsMallocBenchMallocBenchCommandLinecpp">trunk/PerformanceTests/MallocBench/MallocBench/CommandLine.cpp</a></li>
<li><a href="#trunkPerformanceTestsMallocBenchMallocBenchCommandLineh">trunk/PerformanceTests/MallocBench/MallocBench/CommandLine.h</a></li>
<li><a href="#trunkPerformanceTestsMallocBenchMallocBenchInterpretercpp">trunk/PerformanceTests/MallocBench/MallocBench/Interpreter.cpp</a></li>
<li><a href="#trunkPerformanceTestsMallocBenchMallocBenchInterpreterh">trunk/PerformanceTests/MallocBench/MallocBench/Interpreter.h</a></li>
<li><a href="#trunkPerformanceTestsMallocBenchMallocBenchflickrcpp">trunk/PerformanceTests/MallocBench/MallocBench/flickr.cpp</a></li>
<li><a href="#trunkPerformanceTestsMallocBenchMallocBenchmaincpp">trunk/PerformanceTests/MallocBench/MallocBench/main.cpp</a></li>
<li><a href="#trunkPerformanceTestsMallocBenchMallocBenchredditcpp">trunk/PerformanceTests/MallocBench/MallocBench/reddit.cpp</a></li>
<li><a href="#trunkPerformanceTestsMallocBenchMallocBenchthevergecpp">trunk/PerformanceTests/MallocBench/MallocBench/theverge.cpp</a></li>
<li><a href="#trunkPerformanceTestsMallocBenchrunmallocbenchmarks">trunk/PerformanceTests/MallocBench/run-malloc-benchmarks</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkPerformanceTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/ChangeLog (167510 => 167511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/ChangeLog        2014-04-18 21:41:39 UTC (rev 167510)
+++ trunk/PerformanceTests/ChangeLog        2014-04-18 22:31:34 UTC (rev 167511)
</span><span class="lines">@@ -1,5 +1,45 @@
</span><span class="cx"> 2014-04-18  Geoffrey Garen  &lt;ggaren@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Added some more Membuster recordings to MallocBench
+        https://bugs.webkit.org/show_bug.cgi?id=131862
+
+        Reviewed by Sam Weinig.
+
+        * MallocBench/MallocBench/Benchmark.cpp:
+        (Benchmark::Benchmark):
+        (Benchmark::run):
+        * MallocBench/MallocBench/Benchmark.h:
+        * MallocBench/MallocBench/CommandLine.cpp:
+        * MallocBench/MallocBench/CommandLine.h:
+        (CommandLine::runs): Added a --runs option, so we can specify zero runs
+        for memory warning benchmarks. Those benchmarks want zero runs so that
+        they can perform a single warmup, which does not free all allocated
+        objects, and then see how far back to 0MB they can get. Running multiple
+        times would accumulate leaks, which is not representative of the
+        simulated scenario.
+
+        * MallocBench/MallocBench/Interpreter.cpp:
+        (Interpreter::Interpreter):
+        (Interpreter::run):
+        * MallocBench/MallocBench/Interpreter.h: Support not deallocating all
+        objects allocated during the recording, so we can do low memory warning
+        memory use measurements, as above.
+
+        * MallocBench/MallocBench/flickr.cpp:
+        (benchmark_flickr_memory_warning):
+        * MallocBench/MallocBench/main.cpp:
+        (main):
+        * MallocBench/MallocBench/reddit.cpp:
+        (benchmark_reddit_memory_warning):
+        * MallocBench/MallocBench/theverge.cpp:
+        (benchmark_theverge_memory_warning): Adopt the API above.
+
+        * MallocBench/run-malloc-benchmarks: I took a first pass at listing all
+        available benchmarks here. Then I commented out the benchmarks that
+        probably aren't reasonable to run by default.
+
+2014-04-18  Geoffrey Garen  &lt;ggaren@apple.com&gt;
+
</ins><span class="cx">         MallocBench: removed the --measure-heap option
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=131854
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkPerformanceTestsMallocBenchMallocBenchBenchmarkcpp"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/MallocBench/MallocBench/Benchmark.cpp (167510 => 167511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MallocBench/MallocBench/Benchmark.cpp        2014-04-18 21:41:39 UTC (rev 167510)
+++ trunk/PerformanceTests/MallocBench/MallocBench/Benchmark.cpp        2014-04-18 22:31:34 UTC (rev 167511)
</span><span class="lines">@@ -119,11 +119,12 @@
</span><span class="cx">     mbfree(chunks, chunkCount * sizeof(void**));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Benchmark::Benchmark(const string&amp; benchmarkName, bool isParallel, size_t heapSize)
</del><ins>+Benchmark::Benchmark(const string&amp; benchmarkName, bool isParallel, size_t runs, size_t heapSize)
</ins><span class="cx">     : m_benchmarkPair()
</span><span class="cx">     , m_elapsedTime()
</span><span class="cx">     , m_isParallel(isParallel)
</span><span class="cx">     , m_heapSize(heapSize)
</span><ins>+    , m_runs(runs)
</ins><span class="cx"> {
</span><span class="cx">     const BenchmarkPair* benchmarkPair = std::find(
</span><span class="cx">         benchmarkPairs, benchmarkPairs + benchmarksPairsCount, benchmarkName);
</span><span class="lines">@@ -162,7 +163,6 @@
</span><span class="cx"> 
</span><span class="cx"> void Benchmark::run()
</span><span class="cx"> {
</span><del>-    static const size_t count = 4;
</del><span class="cx">     static const size_t objectSize = 32;
</span><span class="cx">     static const size_t chunkSize = 1024 * 1024;
</span><span class="cx">     
</span><span class="lines">@@ -170,14 +170,14 @@
</span><span class="cx"> 
</span><span class="cx">     runOnce(); // Warmup run.
</span><span class="cx"> 
</span><del>-    for (size_t i = 0; i &lt; count; ++i) {
</del><ins>+    for (size_t i = 0; i &lt; m_runs; ++i) {
</ins><span class="cx">         double start = currentTimeMS();
</span><span class="cx">         runOnce();
</span><span class="cx">         double end = currentTimeMS();
</span><span class="cx">         double elapsed = end - start;
</span><span class="cx">         m_elapsedTime += elapsed;
</span><span class="cx">     }
</span><del>-    m_elapsedTime /= count;
</del><ins>+    m_elapsedTime /= m_runs;
</ins><span class="cx"> 
</span><span class="cx">     deallocateHeap(heap, m_heapSize, chunkSize, objectSize);
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkPerformanceTestsMallocBenchMallocBenchBenchmarkh"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/MallocBench/MallocBench/Benchmark.h (167510 => 167511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MallocBench/MallocBench/Benchmark.h        2014-04-18 21:41:39 UTC (rev 167510)
+++ trunk/PerformanceTests/MallocBench/MallocBench/Benchmark.h        2014-04-18 22:31:34 UTC (rev 167511)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx">     static double currentTimeMS();
</span><span class="cx">     static Memory currentMemoryBytes();
</span><span class="cx"> 
</span><del>-    Benchmark(const std::string&amp;, bool isParallel, size_t heapSize);
</del><ins>+    Benchmark(const std::string&amp;, bool isParallel, size_t runs, size_t heapSize);
</ins><span class="cx">     
</span><span class="cx">     bool isValid() { return m_benchmarkPair; }
</span><span class="cx">     
</span><span class="lines">@@ -76,6 +76,7 @@
</span><span class="cx"> 
</span><span class="cx">     const BenchmarkPair* m_benchmarkPair;
</span><span class="cx">     bool m_isParallel;
</span><ins>+    size_t m_runs;
</ins><span class="cx">     size_t m_heapSize;
</span><span class="cx"> 
</span><span class="cx">     Memory m_memory;
</span></span></pre></div>
<a id="trunkPerformanceTestsMallocBenchMallocBenchCommandLinecpp"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/MallocBench/MallocBench/CommandLine.cpp (167510 => 167511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MallocBench/MallocBench/CommandLine.cpp        2014-04-18 21:41:39 UTC (rev 167510)
+++ trunk/PerformanceTests/MallocBench/MallocBench/CommandLine.cpp        2014-04-18 22:31:34 UTC (rev 167511)
</span><span class="lines">@@ -32,18 +32,20 @@
</span><span class="cx">     {&quot;benchmark&quot;, required_argument, 0, 'b'},
</span><span class="cx">     {&quot;parallel&quot;, no_argument, 0, 'p'},
</span><span class="cx">     {&quot;heap&quot;, required_argument, 0, 'h'},
</span><ins>+    {&quot;runs&quot;, required_argument, 0, 'r'},
</ins><span class="cx">     {0, 0, 0, 0}
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> CommandLine::CommandLine(int argc, char** argv)
</span><span class="cx">     : m_argc(argc)
</span><span class="cx">     , m_argv(argv)
</span><del>-    , m_isParallel()
-    , m_heapSize()
</del><ins>+    , m_isParallel(false)
+    , m_heapSize(0)
+    , m_runs(4)
</ins><span class="cx"> {
</span><span class="cx">     int optionIndex = 0;
</span><span class="cx">     int ch;
</span><del>-    while ((ch = getopt_long(argc, argv, &quot;b:p:h:m&quot;, longOptions, &amp;optionIndex)) != -1) {
</del><ins>+    while ((ch = getopt_long(argc, argv, &quot;b:p:h:r&quot;, longOptions, &amp;optionIndex)) != -1) {
</ins><span class="cx">         switch (ch)
</span><span class="cx">         {
</span><span class="cx">             case 'b':
</span><span class="lines">@@ -58,6 +60,10 @@
</span><span class="cx">                 m_heapSize = atoi(optarg) * 1024 * 1024;
</span><span class="cx">                 break;
</span><span class="cx"> 
</span><ins>+            case 'r':
+                m_runs = atoi(optarg);
+                break;
+
</ins><span class="cx">             default:
</span><span class="cx">                 break;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkPerformanceTestsMallocBenchMallocBenchCommandLineh"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/MallocBench/MallocBench/CommandLine.h (167510 => 167511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MallocBench/MallocBench/CommandLine.h        2014-04-18 21:41:39 UTC (rev 167510)
+++ trunk/PerformanceTests/MallocBench/MallocBench/CommandLine.h        2014-04-18 22:31:34 UTC (rev 167511)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx">     const std::string&amp; benchmarkName() { return m_benchmarkName; }
</span><span class="cx">     bool isParallel() { return m_isParallel; }
</span><span class="cx">     size_t heapSize() { return m_heapSize; }
</span><ins>+    size_t runs() { return m_runs; }
</ins><span class="cx"> 
</span><span class="cx">     void printUsage();
</span><span class="cx"> 
</span><span class="lines">@@ -44,4 +45,5 @@
</span><span class="cx">     std::string m_benchmarkName;
</span><span class="cx">     bool m_isParallel;
</span><span class="cx">     size_t m_heapSize;
</span><ins>+    size_t m_runs;
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkPerformanceTestsMallocBenchMallocBenchInterpretercpp"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/MallocBench/MallocBench/Interpreter.cpp (167510 => 167511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MallocBench/MallocBench/Interpreter.cpp        2014-04-18 21:41:39 UTC (rev 167510)
+++ trunk/PerformanceTests/MallocBench/MallocBench/Interpreter.cpp        2014-04-18 22:31:34 UTC (rev 167511)
</span><span class="lines">@@ -40,7 +40,8 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;mbmalloc.h&quot;
</span><span class="cx"> 
</span><del>-Interpreter::Interpreter(const char* fileName)
</del><ins>+Interpreter::Interpreter(const char* fileName, bool shouldFreeAllObjects)
+    : m_shouldFreeAllObjects(shouldFreeAllObjects)
</ins><span class="cx"> {
</span><span class="cx">     m_fd = open(fileName, O_RDWR, S_IRUSR | S_IWUSR);
</span><span class="cx">     if (m_fd == -1)
</span><span class="lines">@@ -120,6 +121,9 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // A recording might not free all of its allocations.
</span><ins>+    if (!m_shouldFreeAllObjects)
+        return;
+
</ins><span class="cx">     for (size_t i = 0; i &lt; m_objects.size(); ++i) {
</span><span class="cx">         if (!m_objects[i].object)
</span><span class="cx">             continue;
</span></span></pre></div>
<a id="trunkPerformanceTestsMallocBenchMallocBenchInterpreterh"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/MallocBench/MallocBench/Interpreter.h (167510 => 167511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MallocBench/MallocBench/Interpreter.h        2014-04-18 21:41:39 UTC (rev 167510)
+++ trunk/PerformanceTests/MallocBench/MallocBench/Interpreter.h        2014-04-18 22:31:34 UTC (rev 167511)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> class Interpreter {
</span><span class="cx"> public:
</span><del>-    Interpreter(const char* fileName);
</del><ins>+    Interpreter(const char* fileName, bool shouldFreeAllObjects = true);
</ins><span class="cx">     ~Interpreter();
</span><span class="cx"> 
</span><span class="cx">     void run();
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx">     struct Op { Opcode opcode; size_t slot; size_t size; };
</span><span class="cx">     struct Record { void* object; size_t size; };
</span><span class="cx"> 
</span><ins>+    bool m_shouldFreeAllObjects;
</ins><span class="cx">     int m_fd;
</span><span class="cx">     size_t m_opCount;
</span><span class="cx">     std::vector&lt;Record&gt; m_objects;
</span></span></pre></div>
<a id="trunkPerformanceTestsMallocBenchMallocBenchflickrcpp"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/MallocBench/MallocBench/flickr.cpp (167510 => 167511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MallocBench/MallocBench/flickr.cpp        2014-04-18 21:41:39 UTC (rev 167510)
+++ trunk/PerformanceTests/MallocBench/MallocBench/flickr.cpp        2014-04-18 22:31:34 UTC (rev 167511)
</span><span class="lines">@@ -55,7 +55,8 @@
</span><span class="cx"> {
</span><span class="cx">     size_t times = 1;
</span><span class="cx"> 
</span><del>-    Interpreter interpreter(&quot;flickr_memory_warning.ops&quot;);
</del><ins>+    bool shouldFreeAllObjects = false;
+    Interpreter interpreter(&quot;flickr_memory_warning.ops&quot;, shouldFreeAllObjects);
</ins><span class="cx">     for (size_t i = 0; i &lt; times; ++i)
</span><span class="cx">         interpreter.run();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkPerformanceTestsMallocBenchMallocBenchmaincpp"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/MallocBench/MallocBench/main.cpp (167510 => 167511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MallocBench/MallocBench/main.cpp        2014-04-18 21:41:39 UTC (rev 167510)
+++ trunk/PerformanceTests/MallocBench/MallocBench/main.cpp        2014-04-18 22:31:34 UTC (rev 167511)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx">         exit(1);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Benchmark benchmark(commandLine.benchmarkName(), commandLine.isParallel(), commandLine.heapSize());
</del><ins>+    Benchmark benchmark(commandLine.benchmarkName(), commandLine.isParallel(), commandLine.runs(), commandLine.heapSize());
</ins><span class="cx">     if (!benchmark.isValid()) {
</span><span class="cx">         cout &lt;&lt; &quot;Invalid benchmark: &quot; &lt;&lt; commandLine.benchmarkName() &lt;&lt; endl &lt;&lt; endl;
</span><span class="cx">         benchmark.printBenchmarks();
</span><span class="lines">@@ -48,12 +48,17 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     string parallel = commandLine.isParallel() ? string(&quot; [ parallel ]&quot;) : string(&quot; [ not parallel ]&quot;);
</span><ins>+
+    stringstream runs;
+    runs &lt;&lt; &quot; [ runs: &quot; &lt;&lt; commandLine.runs() &lt;&lt; &quot; ]&quot;;
+
</ins><span class="cx">     stringstream heapSize;
</span><span class="cx">     if (commandLine.heapSize())
</span><span class="cx">         heapSize &lt;&lt; &quot; [ heap: &quot; &lt;&lt; commandLine.heapSize() / 1024 / 1024 &lt;&lt; &quot;MB ]&quot;;
</span><span class="cx">     else
</span><span class="cx">         heapSize &lt;&lt; &quot; [ heap: 0MB ]&quot;;
</span><del>-    cout &lt;&lt; &quot;Running &quot; &lt;&lt; commandLine.benchmarkName() &lt;&lt; parallel &lt;&lt; heapSize.str() &lt;&lt; &quot;...&quot; &lt;&lt; endl;
</del><ins>+
+    cout &lt;&lt; &quot;Running &quot; &lt;&lt; commandLine.benchmarkName() &lt;&lt; parallel &lt;&lt; heapSize.str() &lt;&lt; runs.str() &lt;&lt; &quot;...&quot; &lt;&lt; endl;
</ins><span class="cx">     benchmark.run();
</span><span class="cx">     benchmark.printReport();
</span><span class="cx">         
</span></span></pre></div>
<a id="trunkPerformanceTestsMallocBenchMallocBenchredditcpp"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/MallocBench/MallocBench/reddit.cpp (167510 => 167511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MallocBench/MallocBench/reddit.cpp        2014-04-18 21:41:39 UTC (rev 167510)
+++ trunk/PerformanceTests/MallocBench/MallocBench/reddit.cpp        2014-04-18 22:31:34 UTC (rev 167511)
</span><span class="lines">@@ -55,7 +55,8 @@
</span><span class="cx"> {
</span><span class="cx">     size_t times = 1;
</span><span class="cx"> 
</span><del>-    Interpreter interpreter(&quot;reddit_memory_warning.ops&quot;);
</del><ins>+    bool shouldFreeAllObjects = false;
+    Interpreter interpreter(&quot;reddit_memory_warning.ops&quot;, shouldFreeAllObjects);
</ins><span class="cx">     for (size_t i = 0; i &lt; times; ++i)
</span><span class="cx">         interpreter.run();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkPerformanceTestsMallocBenchMallocBenchthevergecpp"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/MallocBench/MallocBench/theverge.cpp (167510 => 167511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MallocBench/MallocBench/theverge.cpp        2014-04-18 21:41:39 UTC (rev 167510)
+++ trunk/PerformanceTests/MallocBench/MallocBench/theverge.cpp        2014-04-18 22:31:34 UTC (rev 167511)
</span><span class="lines">@@ -55,7 +55,8 @@
</span><span class="cx"> {
</span><span class="cx">     size_t times = 1;
</span><span class="cx"> 
</span><del>-    Interpreter interpreter(&quot;theverge_memory_warning.ops&quot;);
</del><ins>+    bool shouldFreeAllObjects = false;
+    Interpreter interpreter(&quot;theverge_memory_warning.ops&quot;, shouldFreeAllObjects);
</ins><span class="cx">     for (size_t i = 0; i &lt; times; ++i)
</span><span class="cx">         interpreter.run();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkPerformanceTestsMallocBenchrunmallocbenchmarks"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/MallocBench/run-malloc-benchmarks (167510 => 167511)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MallocBench/run-malloc-benchmarks        2014-04-18 21:41:39 UTC (rev 167510)
+++ trunk/PerformanceTests/MallocBench/run-malloc-benchmarks        2014-04-18 22:31:34 UTC (rev 167511)
</span><span class="lines">@@ -7,30 +7,52 @@
</span><span class="cx"> $productDir = `perl -e 'use lib \&quot;#{$binDir}/../../Tools/Scripts\&quot;; use webkitdirs; print productDir()'`
</span><span class="cx"> 
</span><span class="cx"> $benchmarks = [
</span><ins>+    # Single-threaded benchmarks.
</ins><span class="cx">     &quot;churn&quot;,
</span><del>-    &quot;churn --parallel&quot;,
</del><span class="cx">     &quot;list_allocate&quot;,
</span><del>-    &quot;list_allocate --parallel&quot;,
</del><span class="cx">     &quot;tree_allocate&quot;,
</span><del>-    &quot;tree_allocate --parallel&quot;,
</del><span class="cx">     &quot;tree_churn&quot;,
</span><del>-    &quot;tree_churn --parallel&quot;,
-    &quot;facebook&quot;,
-    &quot;facebook --parallel&quot;,
</del><span class="cx">     &quot;fragment&quot;,
</span><del>-    &quot;fragment --parallel&quot;,
</del><span class="cx">     &quot;fragment_iterate&quot;,
</span><del>-    &quot;fragment_iterate --parallel&quot;,
</del><ins>+    &quot;medium&quot;,
+    &quot;big&quot;,
+
+    # Benchmarks based on browser recordings.
+    &quot;facebook&quot;,
+    &quot;reddit&quot;,
+    &quot;flickr&quot;,
+    &quot;theverge&quot;,
+
+    # Multi-threaded benchmark variants.
</ins><span class="cx">     &quot;message_one&quot;,
</span><span class="cx">     &quot;message_many&quot;,
</span><del>-    &quot;medium&quot;,
</del><ins>+    &quot;churn --parallel&quot;,
+    &quot;list_allocate --parallel&quot;,
+    &quot;tree_allocate --parallel&quot;,
+    &quot;tree_churn --parallel&quot;,
+    # &quot;facebook --parallel&quot;,
+    # &quot;reddit --parallel&quot;,
+    # &quot;flickr --parallel&quot;,
+    # &quot;theverge --parallel&quot;,
+    &quot;fragment --parallel&quot;,
+    &quot;fragment_iterate --parallel&quot;,
+
+    # These tests often crash TCMalloc: &lt;rdar://problem/13657137&gt;.
</ins><span class="cx">     &quot;medium --parallel&quot;,
</span><del>-    &quot;big&quot;,
</del><span class="cx">     &quot;big --parallel&quot;,
</span><ins>+
+    # Enable these tests to test memory footprint. The way they run is not
+    # really compatible with throughput testing.
+    # &quot;reddit_memory_warning --runs 0&quot;,
+    # &quot;flickr_memory_warning --runs 0&quot;,
+    # &quot;theverge_memory_warning --runs 0&quot;,
+
+    # 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.
+    # &quot;balloon&quot;
</ins><span class="cx"> ]
</span><span class="cx"> 
</span><span class="cx"> $heap = 0
</span><del>-$measureHeap = false
</del><span class="cx"> 
</span><span class="cx"> def usage
</span><span class="cx">         puts &quot;run-malloc-benchmarks [options] &lt;Name:/path/to/dylib&gt; [&lt;Name:/path/to/dylib&gt;]&quot;
</span><span class="lines">@@ -175,7 +197,6 @@
</span><span class="cx">     GetoptLong.new(
</span><span class="cx">         ['--benchmark', GetoptLong::REQUIRED_ARGUMENT],
</span><span class="cx">         ['--heap', GetoptLong::REQUIRED_ARGUMENT],
</span><del>-        ['--measure-heap', GetoptLong::NO_ARGUMENT],
</del><span class="cx">         ['--help', GetoptLong::NO_ARGUMENT],
</span><span class="cx">     ).each {
</span><span class="cx">         | opt, arg |
</span><span class="lines">@@ -184,8 +205,6 @@
</span><span class="cx">             $benchmarks = [ arg ]
</span><span class="cx">         when '--heap'
</span><span class="cx">             $heap = arg
</span><del>-        when '--measure-heap'
-            $measureHeap = true
</del><span class="cx">         when '--help'
</span><span class="cx">             usage
</span><span class="cx">             exit 1
</span><span class="lines">@@ -243,12 +262,12 @@
</span><span class="cx">         dylibs.each {
</span><span class="cx">             | dylib |
</span><span class="cx"> 
</span><del>-            $stderr.print &quot;\rRUNNING #{dylib.name}: #{benchmark}...                &quot;
</del><ins>+            $stderr.print &quot;\rRUNNING #{dylib.name}: #{benchmark}...                                &quot;
</ins><span class="cx">             env = &quot;DYLD_LIBRARY_PATH='#{Pathname.new(dylib.path).dirname}' &quot;
</span><span class="cx">             if dylib.name == &quot;NanoMalloc&quot;
</span><span class="cx">                 env += &quot;MallocNanoZone=1 &quot;
</span><span class="cx">             end
</span><del>-            input = &quot;cd '#{$productDir}'; #{env} '#{$productDir}/MallocBench' --benchmark #{benchmark} --heap #{$heap} #{$measureHeap ? '--measure-heap' : ''}&quot;
</del><ins>+            input = &quot;cd '#{$productDir}'; #{env} '#{$productDir}/MallocBench' --benchmark #{benchmark} --heap #{$heap}}&quot;
</ins><span class="cx">             output =`#{input}`
</span><span class="cx">             splitOutput = output.split(&quot;\n&quot;)
</span><span class="cx"> 
</span><span class="lines">@@ -267,9 +286,9 @@
</span><span class="cx">         print
</span><span class="cx">         print lpad(&quot;&quot;, fieldSize)
</span><span class="cx">         print lpad(dylibs[0].name, fieldSize)
</span><del>-        if dylibs[1]
</del><ins>+        if dylibs.length &gt; 1
</ins><span class="cx">             print lpad(dylibs[1].name, fieldSize)
</span><del>-            print lpad(&quot;Δ&quot;, fieldSize * 1.25)
</del><ins>+            print lpad(&quot;Δ&quot;, fieldSize)
</ins><span class="cx">         end
</span><span class="cx">         print &quot;\n&quot;
</span><span class="cx">     end
</span><span class="lines">@@ -285,7 +304,7 @@
</span><span class="cx">             if results[0][1]
</span><span class="cx">                 means.push(meanFunction.call(results.collect { | stats | stats[1].result }))
</span><span class="cx">                 print lpad(&quot;#{prettify(means[1].round, suffix)}&quot;, fieldSize)
</span><del>-                print lpad(compareFunction.call(means[0], means[1]), fieldSize * 1.25)
</del><ins>+                print lpad(compareFunction.call(means[0], means[1]), fieldSize)
</ins><span class="cx">             end
</span><span class="cx"> 
</span><span class="cx">             print &quot;\n&quot;
</span><span class="lines">@@ -304,7 +323,7 @@
</span><span class="cx"> 
</span><span class="cx">             if stats[1]
</span><span class="cx">                 print lpad(&quot;#{prettify(stats[1].result, suffix)}&quot;, fieldSize)
</span><del>-                print lpad(compareFunction.call(stats[0].result, stats[1].result), fieldSize * 1.25)
</del><ins>+                print lpad(compareFunction.call(stats[0].result, stats[1].result), fieldSize)
</ins><span class="cx">             end
</span><span class="cx"> 
</span><span class="cx">             print &quot;\n&quot;
</span></span></pre>
</div>
</div>

</body>
</html>