-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Allow preinitializing spans created from arrays #107575
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
Conversation
|
Thank you! |
agocke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few suggestions on how you could use patterns to remove some repeated conditionals.
Feel free to ignore this feedback. Sometimes I find this useful, sometimes it reads worse. It's a judgement call.
|
|
||
| instance = new ReadOnlySpanValue(readOnlySpanElementType, bytes, byteOffset, byteLength); | ||
| } | ||
| else if (readOnlySpanElementType != null && ctorSig.Length == 1 && ctorSig[0].IsArray |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| else if (readOnlySpanElementType != null && ctorSig.Length == 1 && ctorSig[0].IsArray | |
| else if (readOnlySpanElementType != null && ctorSig is [ { IsArray: true }] |
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/TypePreinit.cs
Outdated
Show resolved
Hide resolved
|
Not a regression but could it be a 9.0 candidate? |
We have a formal list of things that are allowed into 9.0 at this point and the only perf fixes that would meet 9.0 bar are "Significant performance regression from last release" (not just regression, it would also need to be significant to even consider a backport). |
Fixes #107541.
Cc @dotnet/ilc-contrib