Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-05-09 07:57:36 +0300
committerHans Goudey <h.goudey@me.com>2021-05-09 07:57:36 +0300
commit518c5ce4cd75aabcc649efb9e118d18622b5ea70 (patch)
tree081a15e98f11aeb7f30f47fa85d1f66314e4c109 /source/blender/blenkernel/intern/spline_base.cc
parentb7afb8ea7001e2717f8d3ab38ec2b13f9fdf4587 (diff)
Geometry Nodes: Improve point instance node performance
This commit uses two changes to improve the performance of the point instance node. **Prevent Reallocations** At 64 bytes, the transform matrix for every instance is rather large, so reallocating the vector as it grows can become a performance bottle- neck. This commit reserves memory for the instances that will be added to prevent unecessary reallocations as the instance vector grows. In a test with 4 million instances of 3 objects in a collection, the node was about 40% faster, from 370ms to 270ms for the node. **Parallelization** Currently the instances are added by appending to a vector. By changing this slightly to fill indices instead, we can parallelize the operation so that multiple threads can fill data at the same time. Tested on a Ryzen 3700x, this reduced the runtime from the above 270ms to 44ms average, bringing the total speedup to ~8x. Note that displaying the instances in the viewport is still much slower than the calculations in node, this change doesn't affect that.
Diffstat (limited to 'source/blender/blenkernel/intern/spline_base.cc')
0 files changed, 0 insertions, 0 deletions