-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Improved Guard APIs codegen #12
Conversation
Easy peasy... I simply renamed the |
Oh... Well that worked, PR should be good to go now, thanks! 🎉 |
I'm gonna see if I can get CI up and running for this PR to improve test visibility. |
@MarcoRossignoli I hate to do this but I can't figure out why the code coverage reports here are empty? Would you be able to take a quick look when you are able, no rush! Thanks! Scratch that, figured it out! Because we are including the shared project directly into the test project I had to configure the <?xml version="1.0" encoding="utf-8" ?>
<RunSettings>
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="XPlat code coverage">
<Configuration>
<Format>lcov</Format>
<ExcludeByFile>**/tests/**/*.cs, **/**/*.Program.cs</ExcludeByFile>
<IncludeTestAssembly>true</IncludeTestAssembly>
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings> |
Codecov Report
@@ Coverage Diff @@
## master #12 +/- ##
=========================================
Coverage ? 19.77%
=========================================
Files ? 4
Lines ? 359
Branches ? 88
=========================================
Hits ? 71
Misses ? 288
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
@Sergio0694 Our code coverage is appalling. I'd like to do some work on that before merging. |
@JimBobSquarePants Are we missing tests for Also, side question - do we need another PR to update the submodule reference for ImageSharp after this is merged? |
@Sergio0694 You can see the coverage here. Once we've finished, yep it's a new PR for each consuming repo. Hopefully this is the last change we'll see for a while. |
Hi guys!
Yep test project is not included in coverage by default Let me know if need further assistance |
@MarcoRossignoli Thanks mate! Once I'd remembered how my project worked it was dead easy. Love how simple the configuration options are! |
The JIT assumes that forward branches are always taken, and with the custom
ThrowHelper
methods used in theGuard
APIs having the[MethodImpl]
attributes, it couldn't see that they were always throwing, so the resulting codegen was not optimal. I've inverted all the conditions so that the forward branch is the likely one (the one that doesn't fault). This allowes the JIT to properly optimize the codegen in methods using theGuard
APIs, eg. by only using jumps for the faulting paths and placing them further down in the code, with the likely branch not having to jump instead. These are the same changes done in theMicrosoft.Toolkit.Diagnostics.Guard
class, see CommunityToolkit/WindowsCommunityToolkit#3323.NOTE: @JimBobSquarePants not sure how to generate that
.tt.bak
file, could you tell me what steps I should do here?