On Mon Aug 14 15:03:01 2023 +0000, Alexandre Julliard wrote:
I expect that any decent compiler is going to move the calculation out of the inner loop, so this won't make any change in performance. Doing micro-optimizations at the C level is usually a waste of time.
Running a mocked-up test on godbolt shows: - clang results in the same assembly with or without the change. - gcc also moves the calculation out of the inner loop (though the changed code does result in slightly shorter assembly).
So yeah, there is no meaningful gain here.