-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Refactor SQLDateTime constants #120996
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
Refactor SQLDateTime constants #120996
Conversation
|
Tagging subscribers to this area: @roji, @SamMonoRT |
21d7db0 to
22edc9f
Compare
src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLDateTime.cs
Show resolved
Hide resolved
src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLDateTime.cs
Show resolved
Hide resolved
src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLDateTime.cs
Show resolved
Hide resolved
src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLDateTime.cs
Show resolved
Hide resolved
|
For those of us who don't make frequent changes to this repo, can you provide a more detailed description of the reason for the changes? Are you just applying coding standards? Are there micro perf improvements in the changes? AI is great at generating the "sometimes obvious" that would help those unfamiliar with the code understand the reason for the changes. |
|
CC. @jkotas for input on the changes here. I did explain a bit on some of the nuance that can exist for For new APIs, we tend to prefer properties always and may use either This is likely not particularly perf sensitive code, so I expect it probably won't make a meaningful difference in most workloads in practice. I think it might be good to just leave as is "unless" we have perf numbers showing real world benefit -or- we want to push towards standardizing on a particular pattern due to it being better for all our possible compilers (AOT, R2R, JIT, interpreter, etc) |
From a SqlClient perspective, this is definitely perf sensitive code. It's hit for every value when inserting or processing database results. |
These changes are a micro-optimization. The proposed change is a bit friendlier for AOT and it is saving a bit of JITed code size (100s bytes according to MihuBot/runtime-utils#1599 linked above), at the cost of some code duplication. I do not expect the effect of these changes to be really observable. |
.NET Framework design guidelines book has some guidance around this:
|
Diffs