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
This commit is contained in:
Ray Molenkamp
2019-11-12 20:55:39 -07:00
parent c69872bd2f
commit d60a60f0cb
6 changed files with 53 additions and 8 deletions

View File

@@ -81,6 +81,12 @@ if(WITH_CODEC_FFMPEG)
add_definitions(-DWITH_FFMPEG)
endif()
if(WITH_TBB)
blender_include_dirs(${TBB_INCLUDE_DIRS})
link_directories(${LIBDIR}/tbb/lib)
endif()
if(WITH_PYTHON)
blender_include_dirs(../blender/python)
add_definitions(-DWITH_PYTHON)
@@ -806,6 +812,15 @@ elseif(WIN32)
)
endif()
if(WITH_TBB_MALLOC_PROXY)
install(
FILES
${LIBDIR}/tbb/lib/tbbmalloc.dll
${LIBDIR}/tbb/lib/tbbmalloc_proxy.dll
DESTINATION "."
)
endif()
if(WITH_CODEC_SNDFILE)
install(
FILES ${LIBDIR}/sndfile/lib/libsndfile-1.dll