[Analyzer]: Recommend usage of constant in stackalloc
expressions
#89478
Labels
api-suggestion
Early API idea and discussion, it is NOT ready for implementation
area-Meta
code-analyzer
Marks an issue that suggests a Roslyn analyzer
Milestone
.NET 8 introduces some performance-related warnings. This made me think of another commonly discussed issue; using constant sizes in
stackalloc
expressions.A dynamically-sized
stackalloc
array can potentially be worse for performance. An analyzer warning for such a situation could be beneficial.Here are some relevant benchmark results: https://gist.github.com/just-ero/7ef8dd2b49fa5c1cf8d47bbbc6112bd6.
The text was updated successfully, but these errors were encountered: