use MathF where possible#19965
Conversation
|
Hey there @symbiogenesis! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
Ok, so this is failing on .NET Standard 2.0 because MathF only exists in .NET Standard 2.1 and above. Is NETSTANDARD2_0 going to be supported on main much longer? If not, then this could wait until that point. |
|
We will need |
|
One option would be to alias MathF on NETSTANDARD2_0 to an internal class. Or just add it directly under the System namespace, while keeping it internal. |
Head branch was pushed to by a user without write access
61033af to
c2125b1
Compare
@jonathanpeppers fixed |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
jonathanpeppers
left a comment
There was a problem hiding this comment.
It would be nice if this one had a Benchmark to know how much it helps. But it seems plausible this should help -- also no new public APIs, straightforward, etc.
|
Added a PathBenchmarker. 2.6% improvement. No big win, but it makes sense for low level code to be optimized, and allow people to build towers of abstraction upon it. If someone wanted to build games on MAUI, for example, then it might matter more. Building thousands of paths in that context may make sense. And, of course, now MathF will be available for further uses. Before
After
|
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
When doing floating point math, we should be using MathF in order to do the calculations as native floating point math. Thus reducing casting and improving performance.