Let's benchmark malloc
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Apr 2014 21:38:49 +0000 (21:38 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Apr 2014 21:38:49 +0000 (21:38 +0000)
commit134dd68fb5e6d0d34a896632526493486f778598
tree13960d7463563baefb20ba754a0e208a1718a0d1
parent2e6dd8476c89c807297a69dc4861a0d9de81f449
Let's benchmark malloc
https://bugs.webkit.org/show_bug.cgi?id=131118

Reviewed by Mark Hahnenberg.

I want to replace fastMalloc with something faster (fasterMalloc?).
I wrote these benchmarks to test / drive development.

* MallocBench: Added.
* MallocBench/MallocBench: Added.
* MallocBench/MallocBench.xcodeproj: Added.
* MallocBench/MallocBench.xcodeproj/project.pbxproj: Added.
* MallocBench/MallocBench/Benchmark.cpp: Added.
(allocateHeap):
(deallocateHeap):
(Benchmark::Benchmark):
(Benchmark::printBenchmarks):
(Benchmark::runOnce):
(Benchmark::run):
(Benchmark::printReport):
(Benchmark::currentTimeMS):
(Benchmark::currentMemoryBytes):
* MallocBench/MallocBench/Benchmark.h: Added.
(Benchmark::Memory::Memory):
(Benchmark::Memory::operator-):
(Benchmark::isValid):
* MallocBench/MallocBench/CPUCount.cpp: Added.
(cpuCount):
* MallocBench/MallocBench/CPUCount.h: Added.
* MallocBench/MallocBench/CommandLine.cpp: Added.
(CommandLine::printUsage):
* MallocBench/MallocBench/CommandLine.h: Added.
(CommandLine::isValid):
(CommandLine::benchmarkName):
(CommandLine::isParallel):
(CommandLine::heapSize):
(CommandLine::measureHeap):
* MallocBench/MallocBench/Interpreter.cpp: Added.
(Interpreter::Interpreter):
(Interpreter::~Interpreter):
(Interpreter::run):
* MallocBench/MallocBench/Interpreter.h: Added.
* MallocBench/MallocBench/balloon.cpp: Added.
(benchmark_balloon):
* MallocBench/MallocBench/balloon.h: Added.
* MallocBench/MallocBench/big.cpp: Added.
(benchmark_big):
* MallocBench/MallocBench/big.h: Added.
* MallocBench/MallocBench/churn.cpp: Added.
(HeapDouble::operator new):
(HeapDouble::operator delete):
(HeapDouble::HeapDouble):
(HeapDouble::operator+=):
(benchmark_churn):
* MallocBench/MallocBench/churn.h: Added.
* MallocBench/MallocBench/crash.ops: Added.
* MallocBench/MallocBench/facebook.cpp: Added.
(benchmark_facebook):
* MallocBench/MallocBench/facebook.h: Added.
* MallocBench/MallocBench/facebook.ops: Added.
* MallocBench/MallocBench/fragment.cpp: Added.
(validate):
(benchmark_fragment):
(benchmark_fragment_iterate):
* MallocBench/MallocBench/fragment.h: Added.
* MallocBench/MallocBench/list.cpp: Added.
(benchmark_list_allocate):
(benchmark_list_traverse):
* MallocBench/MallocBench/list.h: Added.
* MallocBench/MallocBench/main.cpp: Added.
(main):
* MallocBench/MallocBench/mbmalloc.cpp: Added.
* MallocBench/MallocBench/mbmalloc.h: Added.
* MallocBench/MallocBench/medium.cpp: Added.
(benchmark_medium):
* MallocBench/MallocBench/medium.h: Added.
* MallocBench/MallocBench/message.cpp: Added.
(benchmark_message_one):
(benchmark_message_many):
* MallocBench/MallocBench/message.h: Added.
* MallocBench/MallocBench/realloc.cpp: Added.
(benchmark_realloc):
* MallocBench/MallocBench/realloc.h: Added.
* MallocBench/MallocBench/tree.cpp: Added.
(benchmark_tree_allocate):
(benchmark_tree_traverse):
(benchmark_tree_churn):
* MallocBench/MallocBench/tree.h: Added.
* MallocBench/run-malloc-benchmarks: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166667 268f45cc-cd09-0410-ab3c-d52691b4dbfc
35 files changed:
PerformanceTests/ChangeLog
PerformanceTests/MallocBench/MallocBench.xcodeproj/project.pbxproj [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/Benchmark.cpp [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/Benchmark.h [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/CPUCount.cpp [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/CPUCount.h [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/CommandLine.cpp [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/CommandLine.h [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/Interpreter.cpp [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/Interpreter.h [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/balloon.cpp [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/balloon.h [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/big.cpp [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/big.h [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/churn.cpp [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/churn.h [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/facebook.cpp [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/facebook.h [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/facebook.ops [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/fragment.cpp [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/fragment.h [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/list.cpp [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/list.h [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/main.cpp [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/mbmalloc.cpp [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/mbmalloc.h [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/medium.cpp [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/medium.h [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/message.cpp [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/message.h [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/realloc.cpp [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/realloc.h [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/tree.cpp [new file with mode: 0644]
PerformanceTests/MallocBench/MallocBench/tree.h [new file with mode: 0644]
PerformanceTests/MallocBench/run-malloc-benchmarks [new file with mode: 0755]