Getting rid of array bound checks using ref-returns and .NET 5
29 wrz 2020 | Blog | Performance | Platform | .net core | memory | IT
Imagine we have a simple class, a wrapper around some array of structs (better data locality etc.): [crayon-5f7816beaae0f566439662/] Now, I would like to have an efficient access to every element. Obviously, a trivial indexer would be inefficient here, as it would return a copy of the given array element (a struct): [crayon-5f7816beaae26940795296/] Luckily, since C# […]