I need to optimize the following function with low-level optimizations (No SIMD, Multithreading). I already applied a lot of optimizations and got it ~65% faster, but it is possible to get it 200% faster. I am practicing on code optimization, some explanation would be welcome. The function describes [the anti-aliased Wu line drawing algorithm](https://en.wikipedia.org/wiki/Xiaolin_Wu%27s_line_algorithm). It draws colored lines. It takes into account the sensitivity of the human eye which can't be changed. Approximations are completely fine. ``` void DrawWuLine( Surface *screen, int X0, int Y0, int X1, int Y1, Color& clrLine ) { /* Make sure the line runs top to bottom */ constexpr float pixelNormalization = 1.f / 255.f; uint primaryColor, secondaryColor; } ``` Any tips or insights on how to get rid of branches inside of the while loops? Other optimizations are welcome.