<!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>[197175] 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/197175">197175</a></dd>
<dt>Author</dt> <dd>ggaren@apple.com</dd>
<dt>Date</dt> <dd>2016-02-26 09:58:58 -0800 (Fri, 26 Feb 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fix some issues in MallocBench
https://bugs.webkit.org/show_bug.cgi?id=154600

Reviewed by Oliver Hunt.

* MallocBench/MallocBench.xcodeproj/project.pbxproj: Make nimlang.ops
a part of the build so that it copies to the right place for execution.

* MallocBench/MallocBench/Interpreter.cpp:
(Interpreter::Interpreter): Don't try to open .ops files for writing
because we're only going to read and we might need extra permissions to
write.

(Interpreter::~Interpreter): Give more context when opening a file fails
to help with debugging.

* MallocBench/MallocBench/stress.cpp:
(benchmark_stress): Reduce iterations to complete in less than 10 seconds.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkPerformanceTestsChangeLog">trunk/PerformanceTests/ChangeLog</a></li>
<li><a href="#trunkPerformanceTestsMallocBenchMallocBenchInterpretercpp">trunk/PerformanceTests/MallocBench/MallocBench/Interpreter.cpp</a></li>
<li><a href="#trunkPerformanceTestsMallocBenchMallocBenchstresscpp">trunk/PerformanceTests/MallocBench/MallocBench/stress.cpp</a></li>
<li><a href="#trunkPerformanceTestsMallocBenchMallocBenchxcodeprojprojectpbxproj">trunk/PerformanceTests/MallocBench/MallocBench.xcodeproj/project.pbxproj</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkPerformanceTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/ChangeLog (197174 => 197175)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/ChangeLog        2016-02-26 17:57:37 UTC (rev 197174)
+++ trunk/PerformanceTests/ChangeLog        2016-02-26 17:58:58 UTC (rev 197175)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2016-02-23  Geoffrey Garen  &lt;ggaren@apple.com&gt;
+
+        Fix some issues in MallocBench
+        https://bugs.webkit.org/show_bug.cgi?id=154600
+
+        Reviewed by Oliver Hunt.
+
+        * MallocBench/MallocBench.xcodeproj/project.pbxproj: Make nimlang.ops
+        a part of the build so that it copies to the right place for execution.
+
+        * MallocBench/MallocBench/Interpreter.cpp:
+        (Interpreter::Interpreter): Don't try to open .ops files for writing
+        because we're only going to read and we might need extra permissions to
+        write.
+
+        (Interpreter::~Interpreter): Give more context when opening a file fails
+        to help with debugging.
+
+        * MallocBench/MallocBench/stress.cpp:
+        (benchmark_stress): Reduce iterations to complete in less than 10 seconds.
+
</ins><span class="cx"> 2016-02-23  Michael Saboff  &lt;msaboff@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed change to revert extraneous changes made part of change set 196955.
</span></span></pre></div>
<a id="trunkPerformanceTestsMallocBenchMallocBenchInterpretercpp"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/MallocBench/MallocBench/Interpreter.cpp (197174 => 197175)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MallocBench/MallocBench/Interpreter.cpp        2016-02-26 17:57:37 UTC (rev 197174)
+++ trunk/PerformanceTests/MallocBench/MallocBench/Interpreter.cpp        2016-02-26 17:58:58 UTC (rev 197175)
</span><span class="lines">@@ -48,9 +48,12 @@
</span><span class="cx">     , m_currentThreadId(0)
</span><span class="cx">     , m_ops(1024)
</span><span class="cx"> {
</span><del>-    m_fd = open(fileName, O_RDWR, S_IRUSR | S_IWUSR);
-    if (m_fd == -1)
-        fprintf(stderr, &quot;failed to open\n&quot;);
</del><ins>+    m_fd = open(fileName, O_RDONLY);
+    if (m_fd == -1) {
+        fprintf(stderr, &quot;Failed to open op file %s: &quot;, fileName);
+        perror(&quot;&quot;);
+        exit(-1);
+    }
</ins><span class="cx"> 
</span><span class="cx">     struct stat buf;
</span><span class="cx">     fstat(m_fd, &amp;buf);
</span><span class="lines">@@ -81,8 +84,10 @@
</span><span class="cx"> Interpreter::~Interpreter()
</span><span class="cx"> {
</span><span class="cx">     int result = close(m_fd);
</span><del>-    if (result == -1)
-        fprintf(stderr, &quot;failed to close\n&quot;);
</del><ins>+    if (result == -1) {
+        perror(&quot;Failed to close op file&quot;);
+        exit(-1);
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Interpreter::run()
</span></span></pre></div>
<a id="trunkPerformanceTestsMallocBenchMallocBenchstresscpp"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/MallocBench/MallocBench/stress.cpp (197174 => 197175)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MallocBench/MallocBench/stress.cpp        2016-02-26 17:57:37 UTC (rev 197174)
+++ trunk/PerformanceTests/MallocBench/MallocBench/stress.cpp        2016-02-26 17:58:58 UTC (rev 197175)
</span><span class="lines">@@ -124,7 +124,7 @@
</span><span class="cx"> {
</span><span class="cx">     const size_t heapSize = 100 * MB;
</span><span class="cx">     const size_t churnSize = .05 * heapSize;
</span><del>-    const size_t churnCount = 10000;
</del><ins>+    const size_t churnCount = 1000;
</ins><span class="cx">     
</span><span class="cx">     srandom(1); // For consistency between runs.
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkPerformanceTestsMallocBenchMallocBenchxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/MallocBench/MallocBench.xcodeproj/project.pbxproj (197174 => 197175)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MallocBench/MallocBench.xcodeproj/project.pbxproj        2016-02-26 17:57:37 UTC (rev 197174)
+++ trunk/PerformanceTests/MallocBench/MallocBench.xcodeproj/project.pbxproj        2016-02-26 17:58:58 UTC (rev 197175)
</span><span class="lines">@@ -24,6 +24,7 @@
</span><span class="cx">                 1447AE9A18FB59E300B3D7FF /* reddit_memory_warning.ops in Copy Files */ = {isa = PBXBuildFile; fileRef = 1447AE9718FB59D900B3D7FF /* reddit_memory_warning.ops */; };
</span><span class="cx">                 1447AE9B18FB59E600B3D7FF /* theverge_memory_warning.ops in Copy Files */ = {isa = PBXBuildFile; fileRef = 1447AE9818FB59D900B3D7FF /* theverge_memory_warning.ops */; };
</span><span class="cx">                 1451FAED18B14B7100DB6D47 /* medium.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1451FAEB18B14B7100DB6D47 /* medium.cpp */; };
</span><ins>+                1486502A1C7CF1CC008AABFE /* nimlang.ops in Copy Files */ = {isa = PBXBuildFile; fileRef = 148650291C7CF182008AABFE /* nimlang.ops */; };
</ins><span class="cx">                 14976EC8177E3649006B819A /* list.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14976EC6177E3649006B819A /* list.cpp */; };
</span><span class="cx">                 14976ECC177E3C87006B819A /* CommandLine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14976ECB177E3C87006B819A /* CommandLine.cpp */; };
</span><span class="cx">                 14976ECE177E3D67006B819A /* Benchmark.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14976ECD177E3D67006B819A /* Benchmark.cpp */; };
</span><span class="lines">@@ -49,6 +50,7 @@
</span><span class="cx">                         dstPath = &quot;&quot;;
</span><span class="cx">                         dstSubfolderSpec = 7;
</span><span class="cx">                         files = (
</span><ins>+                                1486502A1C7CF1CC008AABFE /* nimlang.ops in Copy Files */,
</ins><span class="cx">                                 1447AE9418FB589400B3D7FF /* reddit.ops in Copy Files */,
</span><span class="cx">                                 1447AE9918FB59E000B3D7FF /* flickr_memory_warning.ops in Copy Files */,
</span><span class="cx">                                 1447AE9B18FB59E600B3D7FF /* theverge_memory_warning.ops in Copy Files */,
</span><span class="lines">@@ -90,6 +92,7 @@
</span><span class="cx">                 1447AE9818FB59D900B3D7FF /* theverge_memory_warning.ops */ = {isa = PBXFileReference; lastKnownFileType = file; name = theverge_memory_warning.ops; path = MallocBench/theverge_memory_warning.ops; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1451FAEB18B14B7100DB6D47 /* medium.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = medium.cpp; path = MallocBench/medium.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1451FAEC18B14B7100DB6D47 /* medium.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = medium.h; path = MallocBench/medium.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                148650291C7CF182008AABFE /* nimlang.ops */ = {isa = PBXFileReference; lastKnownFileType = file; name = nimlang.ops; path = MallocBench/nimlang.ops; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 14976EC6177E3649006B819A /* list.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = list.cpp; path = MallocBench/list.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 14976EC7177E3649006B819A /* list.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = list.h; path = MallocBench/list.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 14976EC9177E3B4A006B819A /* Benchmark.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Benchmark.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -120,7 +123,6 @@
</span><span class="cx">                 65E401A51C657A87003C6E9C /* nimlang.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = nimlang.h; path = MallocBench/nimlang.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 65E401AA1C73B068003C6E9C /* alloc_free.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = alloc_free.cpp; path = MallocBench/alloc_free.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 65E401AB1C73B068003C6E9C /* alloc_free.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = alloc_free.h; path = MallocBench/alloc_free.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                65E401AD1C77E7C8003C6E9C /* nimlang.ops */ = {isa = PBXFileReference; lastKnownFileType = file; name = nimlang.ops; path = MallocBench/nimlang.ops; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx"> /* End PBXFileReference section */
</span><span class="cx"> 
</span><span class="cx"> /* Begin PBXFrameworksBuildPhase section */
</span><span class="lines">@@ -226,8 +228,8 @@
</span><span class="cx">                                 1444AE95177E8DF200F8030A /* message.h */,
</span><span class="cx">                                 14105E8018E13EEC003A106E /* realloc.cpp */,
</span><span class="cx">                                 65E401A41C657A87003C6E9C /* nimlang.cpp */,
</span><del>-                                65E401AD1C77E7C8003C6E9C /* nimlang.ops */,
</del><span class="cx">                                 65E401A51C657A87003C6E9C /* nimlang.h */,
</span><ins>+                                148650291C7CF182008AABFE /* nimlang.ops */,
</ins><span class="cx">                                 14105E8118E13EEC003A106E /* realloc.h */,
</span><span class="cx">                                 1447AE9718FB59D900B3D7FF /* reddit_memory_warning.ops */,
</span><span class="cx">                                 1447AE8A18FB584200B3D7FF /* reddit.cpp */,
</span></span></pre>
</div>
</div>

</body>
</html>