MallocBench: removed the --measure-heap option
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Apr 2014 20:46:18 +0000 (20:46 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Apr 2014 20:46:18 +0000 (20:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=131854

Reviewed by Sam Weinig.

As of <https://bugs.webkit.org/show_bug.cgi?id=131661>, measuring the
heap is fast, so there's no reason to disable it.

* MallocBench/MallocBench/Benchmark.cpp:
(Benchmark::Benchmark):
(Benchmark::run):
(Benchmark::printReport):
* MallocBench/MallocBench/Benchmark.h:
* MallocBench/MallocBench/CommandLine.cpp:
(CommandLine::printUsage):
* MallocBench/MallocBench/CommandLine.h:
(CommandLine::heapSize):
(CommandLine::measureHeap): Deleted.
* MallocBench/MallocBench/main.cpp:
(main):

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

PerformanceTests/ChangeLog
PerformanceTests/MallocBench/MallocBench/Benchmark.cpp
PerformanceTests/MallocBench/MallocBench/Benchmark.h
PerformanceTests/MallocBench/MallocBench/CommandLine.cpp
PerformanceTests/MallocBench/MallocBench/CommandLine.h
PerformanceTests/MallocBench/MallocBench/main.cpp

index a2fcd09..9c4021e 100644 (file)
@@ -1,3 +1,26 @@
+2014-04-18  Geoffrey Garen  <ggaren@apple.com>
+
+        MallocBench: removed the --measure-heap option
+        https://bugs.webkit.org/show_bug.cgi?id=131854
+
+        Reviewed by Sam Weinig.
+
+        As of <https://bugs.webkit.org/show_bug.cgi?id=131661>, measuring the
+        heap is fast, so there's no reason to disable it.
+
+        * MallocBench/MallocBench/Benchmark.cpp:
+        (Benchmark::Benchmark):
+        (Benchmark::run):
+        (Benchmark::printReport):
+        * MallocBench/MallocBench/Benchmark.h:
+        * MallocBench/MallocBench/CommandLine.cpp:
+        (CommandLine::printUsage):
+        * MallocBench/MallocBench/CommandLine.h:
+        (CommandLine::heapSize):
+        (CommandLine::measureHeap): Deleted.
+        * MallocBench/MallocBench/main.cpp:
+        (main):
+
 2014-04-16  Alexandru Chiculita  <achicu@adobe.com>
 
         Improve performance of the RenderLayerCompositor::OverlapMap
index a873611..55bef83 100644 (file)
@@ -119,12 +119,11 @@ static void deallocateHeap(void*** chunks, size_t heapSize, size_t chunkSize, si
     mbfree(chunks, chunkCount * sizeof(void**));
 }
 
-Benchmark::Benchmark(const string& benchmarkName, bool isParallel, bool measureHeap, size_t heapSize)
+Benchmark::Benchmark(const string& benchmarkName, bool isParallel, size_t heapSize)
     : m_benchmarkPair()
     , m_elapsedTime()
     , m_isParallel(isParallel)
     , m_heapSize(heapSize)
-    , m_measureHeap(measureHeap)
 {
     const BenchmarkPair* benchmarkPair = std::find(
         benchmarkPairs, benchmarkPairs + benchmarksPairsCount, benchmarkName);
@@ -182,9 +181,6 @@ void Benchmark::run()
 
     deallocateHeap(heap, m_heapSize, chunkSize, objectSize);
     
-    if (!m_measureHeap)
-        return;
-    
     mbscavenge();
     m_memory = currentMemoryBytes();
 }
@@ -194,9 +190,6 @@ void Benchmark::printReport()
     size_t kB = 1024;
 
     cout << "Time:       \t" << m_elapsedTime << "ms" << endl;
-    if (!m_measureHeap)
-        return;
-
     cout << "Memory:     \t" << m_memory.resident / kB << "kB" << endl;
     cout << "Peak Memory:\t" << m_memory.residentMax / kB << "kB" << endl;
 }
index cf9781e..b93a88b 100644 (file)
@@ -59,7 +59,7 @@ public:
     static double currentTimeMS();
     static Memory currentMemoryBytes();
 
-    Benchmark(const std::string&, bool isParallel, bool measureHeap, size_t heapSize);
+    Benchmark(const std::string&, bool isParallel, size_t heapSize);
     
     bool isValid() { return m_benchmarkPair; }
     
@@ -76,7 +76,6 @@ private:
 
     const BenchmarkPair* m_benchmarkPair;
     bool m_isParallel;
-    bool m_measureHeap;
     size_t m_heapSize;
 
     Memory m_memory;
index 9d3f886..f832c2f 100644 (file)
@@ -32,7 +32,6 @@ struct option CommandLine::longOptions[] =
     {"benchmark", required_argument, 0, 'b'},
     {"parallel", no_argument, 0, 'p'},
     {"heap", required_argument, 0, 'h'},
-    {"measure-heap", no_argument, 0, 'm'},
     {0, 0, 0, 0}
 };
 
@@ -41,7 +40,6 @@ CommandLine::CommandLine(int argc, char** argv)
     , m_argv(argv)
     , m_isParallel()
     , m_heapSize()
-    , m_measureHeap()
 {
     int optionIndex = 0;
     int ch;
@@ -60,10 +58,6 @@ CommandLine::CommandLine(int argc, char** argv)
                 m_heapSize = atoi(optarg) * 1024 * 1024;
                 break;
 
-            case 'm':
-                m_measureHeap = true;
-                break;
-
             default:
                 break;
         }
@@ -75,5 +69,5 @@ void CommandLine::printUsage()
     std::string fullPath(m_argv[0]);
     size_t pos = fullPath.find_last_of("/") + 1;
     std::string program = fullPath.substr(pos);
-    std::cout << "Usage: " << program << " --benchmark benchmark_name [ --parallel ] [ --measure-heap ] [ --heap MB ]" << std::endl;
+    std::cout << "Usage: " << program << " --benchmark benchmark_name [ --parallel ] [ --heap MB ]" << std::endl;
 }
index 29242bd..14d7329 100644 (file)
@@ -33,7 +33,6 @@ public:
     const std::string& benchmarkName() { return m_benchmarkName; }
     bool isParallel() { return m_isParallel; }
     size_t heapSize() { return m_heapSize; }
-    bool measureHeap() { return m_measureHeap; }
 
     void printUsage();
 
@@ -45,5 +44,4 @@ private:
     std::string m_benchmarkName;
     bool m_isParallel;
     size_t m_heapSize;
-    bool m_measureHeap;
 };
index 53781e0..db80d44 100644 (file)
@@ -40,7 +40,7 @@ int main(int argc, char** argv)
         exit(1);
     }
 
-    Benchmark benchmark(commandLine.benchmarkName(), commandLine.isParallel(), commandLine.measureHeap(), commandLine.heapSize());
+    Benchmark benchmark(commandLine.benchmarkName(), commandLine.isParallel(), commandLine.heapSize());
     if (!benchmark.isValid()) {
         cout << "Invalid benchmark: " << commandLine.benchmarkName() << endl << endl;
         benchmark.printBenchmarks();