98e33adac24082d43b2439ea4ea264b10329704b
We need a separate array that we can change in during the parallel group construction. That array tells where in each group the index is added. Building this array is expensive, since construcing a new `Array` fills its elements serially. There are two possible solutions: 1. Use a copy of the offsets to increment result indices directly 2. Rely on OS-optimized `calloc` instead of `malloc` and a copy/fill Both depend on using `fetch_and_add` instead of `add_and_fetch`. The vertex to corner and edge to corner map creation is optimized by this commit, though the benefits will be useful elsewhere in the future. | | Before | 1. offsets copy | 2. calloc | | -------- | ------- | --------------- | --------------- | | Grid 1m | 3.1 ms | 1.9 ms (1.63x) | 1.8 ms (1.72x) | | Grid 16m | 51.8 ms | 33.3 ms (1.55x) | 32.7 ms (1.58x) | This commit implements the calloc solution, since it's slightly faster and simpler. In the future, `Array` could do this optimization itself when it detects that its fill value is just zero bytes. Pull Request: https://projects.blender.org/blender/blender/pulls/112065
…
Blender
Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.
Project Pages
Development
License
Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different, but compatible license.
See blender.org/about/license for details.
Description
Languages
C++
78%
Python
14.9%
C
2.9%
GLSL
1.9%
CMake
1.2%
Other
0.9%
