Files
test2/source
Hans Goudey 6702f74d0b Curves: Improve copy and move assignment
Previously the default constructor ran, then the copy or move
assignment. This resulted in extra creations of runtime data,
including allocations of all the shared caches, only for them
to be immediately replaced by the new ones. Move assignment also
didn't clear the source curves completely, which could result in
higher memory usage or worse, extra users for attribute arrays,
which could lead to unnecessary copying.

In a very simple test repeatedly copying a tiny Curves data-block,
I observed a 30% performance improvement.

This also fixes a memory leak of the offsets in the copy assignment.

Pull Request: https://projects.blender.org/blender/blender/pulls/117932
2024-02-07 15:40:29 +01:00
..