Skip to content

Conversation

@J005t67
Copy link
Contributor

@J005t67 J005t67 commented Dec 17, 2025

The new constructor only needs one argument , (so less instructions on the caller side)
Also, it avoids the costly conversion from floats to bytes. (less instructions in the function itself.)
It only needs 4 byte of data, in stead of 3 or 4 times size of float, (12 or 16 bytes). This also reduces code size a bit and so it reduces the pressure on the cache a bit.
None of the above is very important, because this is not where the performance bottlenecks are.

Anyway, I do like the following improvements:

  • the comment that says not to recreate the colors repeatedly for each frame.
  • the fact that ColorRgba is now more ready to replace the use of System.Windows.Drawing.Color that ties us to windows and makes the current code less portable.

@J005t67 J005t67 requested review from a team December 17, 2025 13:00
@J005t67 J005t67 force-pushed the performance/5-colorrgba-uint32-constructor branch from 54b40a4 to 34d826f Compare December 29, 2025 23:03
@J005t67 J005t67 force-pushed the performance/5-colorrgba-uint32-constructor branch from 34d826f to 954797f Compare January 1, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant