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
+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
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);
deallocateHeap(heap, m_heapSize, chunkSize, objectSize);
- if (!m_measureHeap)
- return;
-
mbscavenge();
m_memory = currentMemoryBytes();
}
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;
}
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; }
const BenchmarkPair* m_benchmarkPair;
bool m_isParallel;
- bool m_measureHeap;
size_t m_heapSize;
Memory m_memory;
{"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}
};
, m_argv(argv)
, m_isParallel()
, m_heapSize()
- , m_measureHeap()
{
int optionIndex = 0;
int ch;
m_heapSize = atoi(optarg) * 1024 * 1024;
break;
- case 'm':
- m_measureHeap = true;
- break;
-
default:
break;
}
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;
}
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();
std::string m_benchmarkName;
bool m_isParallel;
size_t m_heapSize;
- bool m_measureHeap;
};
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();