Page MenuHome

Curves: Port endpoint selection node to new data-block
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Mar 3 2022, 4:46 AM.

Details

Summary

The node should be faster than in 3.1, for a few reasons:

  • It doesn't need to calculate and allocate the curve offsets.
  • It doesn't need to de-reference a pointer for each curve.
  • The inputs are accessed from the virual arrays fewer times.

On top of that, I added two other performance improvements:

  • The node is multi-threaded when there are many curves.
  • There are generated special cases for single value and span inputs.

To make the code a bit simpler, I added new methods to IndexRange
to mirror what is available for Span.

Performance
With a set position node affecting 1 million splines with a selection
based on this node, on an Intel i5 8250U (times are approximate):

BeforeAfterSpeedup
760 ms60 ms13x

This will also include the performance increase for the set position node
from 4c66bd5da256779ef5a308d86a.

Diff Detail

Repository
rB Blender

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Mar 3 2022, 4:46 AM
Hans Goudey (HooglyBoogly) created this revision.
Hans Goudey (HooglyBoogly) edited the summary of this revision. (Show Details)
source/blender/blenlib/BLI_index_range.hh
229–267 ↗(On Diff #48875)

I'll add some tests for these if you think they're reasonable. And I can split them to a separate commit if you'd prefer too.

Jacques Lucke (JacquesLucke) added inline comments.
source/blender/blenlib/BLI_index_range.hh
229–267 ↗(On Diff #48875)

Adding some tests would be good. A separate commit too, doesn't need separate review though.

230 ↗(On Diff #48875)

Span -> IndexRange.

This revision is now accepted and ready to land.Mar 3 2022, 4:36 PM