diff options
author | Hans Goudey <h.goudey@me.com> | 2022-10-04 19:16:09 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-10-04 19:16:25 +0300 |
commit | d2f0cb67457294c0e6479314464e7ec796a39d65 (patch) | |
tree | 21d99a6bca3e441fa5f8cf5a0ab168a34eb678dc /intern | |
parent | 4d9588ee454e2b7170ee4e34c2a1b45baec736cc (diff) |
BLI: Unroll vector loops for better performance on GCC
On GCC, the loops created by `BLI_VEC_OP_IMPL` were not always
unrolled, leading to branching. For `attribute_math::mix4<float3>`,
this lead to a significant performance regression compared to its
older `interp_v3_v3v3v3v3` counterpart.
Instead of a using macros to create the for loops, use variadic
templates to manually unroll them. The compiler might do it anyway
(I didn't observe any effect on Clang in my tests), but there should
be no reason not to unroll these small loops, and making it explicit
and removing use of macros seems better.
On a Ryzen 3700x, this commits doubles the performance of Catmull
Rom curve position evaluation (from 18-19ms to around 9-10ms).
Differential Revision: https://developer.blender.org/D16136
Diffstat (limited to 'intern')
0 files changed, 0 insertions, 0 deletions