Uh oh!
There was an error while loading. Please reload this page.
add IsOSPlatformOrLater and IsOSPlatformEarlierThan methods - #39005
Conversation
Dotnet-GitSync-Bot
commented
Jul 9, 2020
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
ghost
commented
Jul 9, 2020
Tagging subscribers to this area: @tommcdon |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
adamsitnik
commented
Jul 9, 2020
The spec mentions that:
@tannergooding@jkotas could you please point me to some doc|PR that explains|shows how to make JIT recognize given method as a constant? |
tannergooding
commented
Jul 9, 2020
I'm not sure the JIT treating them as a constant is necessarily a .NET 5 goal, but rather an eventual goal. I don't think getting the JIT to support Jan or someone else may know better or have a different opinion here, of course 😄 |
I agree with @tannergooding that the design of these APIs is unfriendly to optimizations, and recognizing the complex pattern as constant would be non-trivial. I do not think we should be building one-off optimizations like that. If somebody needs to call this on a hot path, they should cache the result in a static readonly bool. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Contributes to #33331