Optimize constant-sized spans of managed types via InlineArray #8442
-
It would be a nice extension of the current features to optimize the following when the size is statically known: {ReadOnly}Span<Type> collection = [ typeof(string), typeof(int) ] // InlineArray size 2, no array alloc. A span of Initially I considered whether expanding allowed |
Beta Was this translation helpful? Give feedback.
Answered by
jnm2
Sep 19, 2024
Replies: 1 comment 1 reply
-
Great suggestion! The spec already allows optimizations such as this; it's at the discretion of the compiler. There's an umbrella issue for compiler optimizations at: dotnet/roslyn#68785 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
CyrusNajmabadi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great suggestion! The spec already allows optimizations such as this; it's at the discretion of the compiler. There's an umbrella issue for compiler optimizations at: dotnet/roslyn#68785