On Fri Dec 2 19:30:10 2022 +0000, Esme Povirk wrote:
I don't think that the loop makes things any clearer for `matrix_multiply` regardless, nor can I think of any reasonable way that the extra integer math and branches would improve performance, so I think that part is fine regardless. For `GdipScaleMatrix`, it's a little less convincing, because the new version of the code is less clear. I'm curious what happens if you apply only the second patch in the series. I suspect that constant propagation combined with the second patch may make the first patch redundant.
The GdipScaleMatrix binary code (after compiling) is most efficient with proposed source code.
I could do whatever you want to get binary code in efficient form (as it is the output from this Merge Request). Could you please describe how constant propagation should looks like?
We could also add some function description, or additional comment, which will describe whole formula.
There are also matrix calculators which would help understand it. For example: https://matrixcalc.org/ Or some nice Wikipedia articles about transformation matrix: https://en.wikipedia.org/wiki/Transformation_matrix#/media/File:2D_affine_tr...
In long term, I would like to optimize all Matrix transformations (Shearing, Rotation)