3 ms·
Interesting approach, but it should be .NET Runtime (or JIT) who would optimize small memory allocations preferring the stack rather than the heap when possible
by garganzol 1y ago
Interesting approach, but it should be .NET Runtime (or JIT) who would optimize small memory allocations preferring the stack rather than the heap when possible.
.NET 10 takes a step in that direction [1].
[1] https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-10/runtime#stack-allocation-of-small-arrays-of-value-types https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotn...