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.
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.
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