News for hackers. Stuff that matters.
Re:Hardware Intrinsics in .NET 8 by xnorswap on Tuesday December 19, 2023 @06:36AM (#38694388)
There are memory management tools:

You can layout a struct (which are value types not class types in c#/dotnet) with LayoutKind attributes: https://learn.microsoft.com/en-us/dotnet/api/system.runtime....

You can also use things like Span<T> and other types for better control.

But honestly C# performs generally so well that it tends to be you only reach for these tools after you spot a performance problem and profile it, which is actually quite rare.

IME most performance problems and solutions still tend to be, "Oh this person took a naive approach here, we can use a specialised loop or data structure to fix that".

There are no comments on this comment yet.