-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
⚡ Prefer built-in conversions over extensibility for perf #1049
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1049 +/- ##
========================================
Coverage 85% 85%
========================================
Files 322 322
Lines 49261 52319 +3058
========================================
+ Hits 42075 44893 +2818
- Misses 7186 7426 +240
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@angularsen I will fill in some missing test coverage in this PR. Also, is there a way to run the branch marking suite on a PR? It would be nice to see proactively rather than after something is already merged. |
Alright. Looks good now. Can we add the benchmarking as an optional check that has to be manually run? |
I don't know how to do that? :D I just reduced the codecov precision from 1 to 0, and changed rounding from up to down (default). |
Oh, I didn't read your question right. |
@tmilnthorp I disabled the auto benchmarking action. There is another action to manually run benchmarks. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@tmilnthorp I'm reopening this in light of #1069 . I think maybe a fair compromise is to merge this PR, and not allow extensions to override built-in functions to mitigate performance issue. I'm not sure I see a good usecase to override built-in functions except to duct-tape fix bugs, but I would rather merge those fixes into the library. What do you think? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
# Conflicts: # UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs # UnitsNet/GeneratedCode/Quantities/Length.g.cs # UnitsNet/GeneratedCode/Quantities/Molarity.g.cs # UnitsNet/GeneratedCode/Quantities/Power.g.cs # UnitsNet/GeneratedCode/Quantities/Pressure.g.cs # UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs # UnitsNet/GeneratedCode/Quantities/Speed.g.cs # UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs
Fixes #1069
Per @lipchev's comments in #1023, I decided to add the local conversion method back (as private
TryToUnit
). This will allow better performance for auto-generated conversions before falling back to the extensibility points.