3 ms·
There has also been a big push on performance and minimising heap allocations in .NET recently, and it's really been paying dividends. .NET also makes it relat
by GordonS 8y ago
There has also been a big push on performance and minimising heap allocations in .NET recently, and it's really been paying dividends.
.NET also makes it relatively simple to work with memory on the stack (especially via `stackalloc`), as well as unmanaged memory on the heap. Of course, many developers never have optimisation problems that require these tools, but they are fantastic when you do need them.
- WorldMaker 8y agoYeah, I've been very impressed with .NET Core's efforts in performance lately. Span<T>, the stack allocation support, and greater "semi-managed" heap memory support, are a major performance breakthrough taken together. It gives the garbage-collected "safe" C# code most of the performance characteristics of pointer-heavy "unsafe" code. It's maybe still too early to make predictions of long-term impact, but it really does seem like it puts C# into a good position to take on even more "performance critical" work day-to-day, possibly keeping C# competitive with (and even mentionable in the same sentence as) languages such as Rust and Go. (Especially when combined with AOT/.NET Native compilation.) It is definitely something I'm keeping an eye on.
- GordonS 8y agoOh, I forgot about intrinsics too! Those will be in .NET Core 3.0, so you'll be able to use SSE, AVX, BMI etc instructions!