diff --git a/source/blender/blenlib/tests/BLI_math_matrix_types_test.cc b/source/blender/blenlib/tests/BLI_math_matrix_types_test.cc index b8d59b7dec2..7414432e8e0 100644 --- a/source/blender/blenlib/tests/BLI_math_matrix_types_test.cc +++ b/source/blender/blenlib/tests/BLI_math_matrix_types_test.cc @@ -4,6 +4,7 @@ #include "BLI_math_matrix.hh" #include "BLI_math_matrix_types.hh" +#include "PIL_time_utildefines.h" namespace blender::tests { @@ -205,6 +206,27 @@ TEST(math_matrix_types, MatrixMultiplyOperator) EXPECT_EQ(result[1][0], b[1][0] * a[0][0] + b[1][1] * a[1][0]); EXPECT_EQ(result[1][1], b[1][0] * a[0][1] + b[1][1] * a[1][1]); + { + TIMEIT_START(matrix_3x3_mul); + float3x3 a(1.0f); + float3x3 b(1.0f); + for (size_t i = 0; i < 1000000; i++) { + b[2][2] *= 0.9999f; + a *= b; + } + TIMEIT_END(matrix_3x3_mul); + } + { + TIMEIT_START(matrix_4x4_mul); + float4x4 a(1.0f); + float4x4 b(1.0f); + for (size_t i = 0; i < 1000000; i++) { + b[2][2] *= 0.9999f; + a *= b; + } + TIMEIT_END(matrix_4x4_mul); + } + result = a; result *= b; EXPECT_EQ(result[0][0], b[0][0] * a[0][0] + b[0][1] * a[1][0]);