What's new in the .NET 11 runtime learn.microsoft.com · 26 points · 6 comments ·...

@best

What's new in the .NET 11 runtime learn.microsoft.com · 26 points · 6 comments · HN thread

TL;DR Microsoft's What's new in .NET 11 runtime page, last updated for release candidate 2, lists changes to the runtime: raised minimum CPU instruction-set requirements, a preview 'Runtime Async' model that moves async state machines into the runtime, many JIT and ReadyToRun optimizations, and assorted platform changes. The page is a feature overview rather than a debate, and the thread is small with six comments.

  • Minimum x86/x64 baseline rises from x86-64-v1 to x86-64-v2 (CX16, POPCNT, SSE3 through SSE4.2), and on Windows Arm64 requires LSE; .NET 11 fails to start on older hardware.
  • Runtime Async (Runtime Async V2) is a preview opt-in via runtime-async=on; in the example, live stack traces drop from 13 frames to 5 because state-machine frames disappear.
  • JIT gains include bounds-check elimination, constant folding of string.Equals on literals, devirtualization of generic virtual methods, and Activator.CreateInstance() treated as exact type.
  • ReadyToRun now specializes Comparer.Default and EqualityComparer.Default, with benchmarks showing up to 20x gains for collections using the default comparer.
  • Async continuations can skip ExecutionContext capture and restore when there is nothing to restore; cached interface dispatch gives up to 200x gains on non-JIT platforms such as iOS.
  • On iOS and tvOS, advisory file locking is now disabled by default, so FileShare is no longer enforced by locks there; it can be re-enabled with DOTNET_SYSTEM_IO_DISABLEFILELOCKING=0.

Discussion The thread is small and mostly positive, with commenters welcoming the runtime async work and the stack trace improvements. One sub-thread turns into a broader comparison of .NET and Go, where commenters argue about performance, memory use, and how enjoyable each language is to write. Tone is friendly and casual, with no notable criticism of the release itself.

  • Runtime async and cleaner stack traces are a welcome improvement (many): Commenters are pleased that async code can perform comparably to compiler-generated state machines while producing more readable stack traces. One expects better stack traces may encourage developers to read them more.
  • C# async is lighter than Go's concurrency model (some): One commenter who uses both says C# async has less overhead than Go's concurrency story and that .NET 11 will make this clearer. They also say Go is less fun to write and is slower for their workloads until the GC is tuned, after which memory use is similar.
  • Go is more efficient, so the choice of .NET is unclear (a few): A commenter asks why teams pick .NET over Go for non-legacy systems, arguing Go is more efficient in syntax and memory. The thread offers only one direct response to this question.

#dotnet #runtime #csharp #async #performance #release