Blender Git Loki
Git Commits -> Revision 309c919
Revision 309c919 by Jacques Lucke (master) October 9, 2020, 09:56 (GMT) |
BKE: parallelize BKE_mesh_calc_edges `BKE_mesh_calc_edges` was the main performance bottleneck in D9141. While openvdb only needed ~115ms, calculating the edges afterwards took ~960ms. Now with some parallelization this is reduced to ~210ms. Parallelizing `BKE_mesh_calc_edges` is not entirely trivial, because it has to perform deduplication and some other things that have to happen in a certain order. Even though the multithreading improves performance with more threads, there are diminishing returns when too many threads are used in this function. The speedup is mainly achieved by having multiple hash tables that are filled in parallel. The distribution of the edges to hash tables is based on a hash (that is different from the hash used in the actual hash tables). I moved the function to C++, because that made it easier for me to optimize it. Furthermore, I added `BLI_task.hh` which contains some light tbb wrappers for parallelization. Reviewers: campbellbarton Differential Revision: https://developer.blender.org/D9151 |
Commit Details:
Full Hash: 309c919ee97e272c08f88ebd8341fe962e71e64d
Parent Commit: 963b45f
Lines Changed: +332, -106
2 Added Paths:
/source/blender/blenkernel/intern/mesh_validate.cc (+255, -0) (View)
/source/blender/blenlib/BLI_task.hh (+63, -0) (View)
/source/blender/blenlib/BLI_task.hh (+63, -0) (View)