haikuwebkit/PerformanceTests/CMakeLists.txt

11 lines
307 B
CMake
Raw Permalink Normal View History

# MallocBench requires malloc_trim for non-Apple platforms
if (NOT USE_SYSTEM_MALLOC)
if (APPLE OR HAVE_MALLOC_TRIM)
add_subdirectory(MallocBench)
else ()
message(WARNING "MallocBench is not available on this platform")
endif ()
[Linux] Port MallocBench https://bugs.webkit.org/show_bug.cgi?id=177856 Reviewed by Filip Pizlo. .: * CMakeLists.txt: PerformanceTests: We would like to optimize locking in bmalloc in Linux by using futex APIs. So we should have the way to ensure this actually improves / does not regress the performance. This patch ports MallocBench to Linux to measure/ensure the effect of bmalloc patch in Linux. While we replace the dispatch serial queue in message.cpp, we still use libdispatch in Benchmark.cpp since we do not have priority mechanism in C++11 threading implementation. We also extend run-malloc-benchmarks to accept cmake style layout of build product directory. And we also support building MallocBench in CMake environment including CMake Mac ports. Currently, we do not support Windows yet. Based on the measurement, we can say the following observation. glibc's malloc performance is not so bad. While bmalloc shows 3.8x (in geomean) performance improvement, bmalloc in Linux shows 2.0x improvement. Since both numbers in bmalloc are similar, we can think that bmalloc's optimization is actually working in Linux too. And even though glibc's malloc perofmrnace is not so bad, bmalloc still offers performance improvement. * CMakeLists.txt: Added. * MallocBench/CMakeLists.txt: Added. * MallocBench/MallocBench.xcodeproj/project.pbxproj: * MallocBench/MallocBench/Benchmark.cpp: (Benchmark::Benchmark): (Benchmark::runOnce): (Benchmark::currentMemoryBytes): Deleted. * MallocBench/MallocBench/Benchmark.h: (Benchmark::Memory::Memory): Deleted. (Benchmark::Memory::operator-): Deleted. * MallocBench/MallocBench/CMakeLists.txt: Added. * MallocBench/MallocBench/CPUCount.cpp: (cpuCount): * MallocBench/MallocBench/Interpreter.cpp: (Interpreter::doMallocOp): * MallocBench/MallocBench/Memory.cpp: Added. (currentMemoryBytes): * MallocBench/MallocBench/Memory.h: Copied from PerformanceTests/MallocBench/MallocBench/CPUCount.cpp. (Memory::Memory): (Memory::operator-): * MallocBench/MallocBench/balloon.cpp: (benchmark_balloon): * MallocBench/MallocBench/mbmalloc.cpp: * MallocBench/MallocBench/message.cpp: (WorkQueue::WorkQueue): (WorkQueue::~WorkQueue): (WorkQueue::dispatchAsync): (WorkQueue::dispatchSync): (benchmark_message_one): (benchmark_message_many): * MallocBench/MallocBench/nimlang.cpp: (benchmark_nimlang): * MallocBench/MallocBench/stress.cpp: (SizeStream::next): * MallocBench/MallocBench/stress_aligned.cpp: * MallocBench/run-malloc-benchmarks: Source/bmalloc: * CMakeLists.txt: Canonical link: https://commits.webkit.org/194175@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222900 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-10-05 07:05:44 +00:00
endif ()
WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()