MRMitchell Robinsoninvercidium.hashnode.dev·Feb 14, 2023 · 2 min readImproving the Performance of Multidimensional Arrays in C#C# has support for multidimensional arrays, which are useful for representing elements in a 2D or 3D grid: int[,] twoDimensions = new int[20, 20]; int[,,] threeDimensions = new int[20, 20, 20]; Under the covers, these arrays are allocated as a singl...00
MRMitchell Robinsoninvercidium.hashnode.dev·Feb 10, 2023 · 2 min readC# - Improving Array Performance with .NET 7.NET 7 introduced a new static class called NativeMemory, which can be used to allocate unmanaged memory. Normally when working with arrays in C#, the .NET runtime manages the allocation of memory and frees it when it's no longer used, hence the name...00