diff options
author | Ray Molenkamp <github@lazydodo.com> | 2019-11-13 06:55:39 +0300 |
---|---|---|
committer | Ray Molenkamp <github@lazydodo.com> | 2019-11-13 06:55:39 +0300 |
commit | d60a60f0cb85087ddebcb47910847f1a0c4b916c (patch) | |
tree | ced2886d1048b56e2b02c4a24744f4d18b6d079d /CMakeLists.txt | |
parent | c69872bd2ff31690156ca5c15a54de850d8e17a7 (diff) |
Add support for the TBB allocator on windows.
The heap on windows is single threaded causing it to lag behind linux in performance in allocation heavy multithreaded scenarios, BVH building is a prime example.
See https://developer.blender.org/D6218 for benchmark results
for testing with the allocator enabled/disabled you can set the environment variable TBB_MALLOC_DISABLE_REPLACEMENT=1 to disable the TBB allocator.
Reviewed By: @sergey
Differential Revision: https://developer.blender.org/D6218
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e468ae36906..1fda1be608b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -170,6 +170,14 @@ option_defaults_init( _init_OPENSUBDIV ) +# TBB malloc is only supported on for windows currently +if(WIN32) + set(_init_TBB_MALLOC_PROXY ON) +else() + set(_init_TBB_MALLOC_PROXY OFF) +endif() + + # customize... if(UNIX AND NOT APPLE) # some of these libraries are problematic on Linux @@ -463,6 +471,7 @@ mark_as_advanced(WITH_ASSERT_ABORT) option(WITH_BOOST "Enable features depending on boost" ON) option(WITH_TBB "Enable features depending on TBB (OpenVDB, OpenImageDenoise, sculpt multithreading)" ON) +option(WITH_TBB_MALLOC_PROXY "Enable the TBB malloc replacement" ${_init_TBB_MALLOC_PROXY}) # Unit testsing option(WITH_GTESTS "Enable GTest unit testing" OFF) |