What .NET 10 GC changes mean for developers
.NET vs JVM, Value Types, and Escape Analysis
- Several commenters compare .NET 10’s GC and escape analysis to the JVM, arguing:
- Some optimizations exist in HotSpot or GraalVM, but .NET has long had advantages like value types and reified generics, avoiding pervasive boxing of generics that Java still suffers from.
- Project Valhalla is seen as a very slow-moving, difficult retrofit for Java, while .NET has had value types from the start.
- Others counter that escape analysis on mainstream JVMs is still limited and that GraalVM’s stronger optimizations were historically paywalled.
Stack Behavior, GC, and Potential Regressions
- Concern: more stack allocation could trigger stack overflows in code that previously ran fine.
- Response: this has happened before across .NET versions; it usually indicates already-fragile code, and stack size is configurable.
- Side discussion on whether stacks can grow like heaps; some argue OS/thread APIs fix max stack size, others note runtimes can implement custom managed stacks.
DATAS GC Tuning and Real-World Impact
- DATAS is seen as more tunable than prior GCs (e.g., Throughput Cost Percentage via
System.GC.DTargetTCP) and suitable for latency-sensitive apps. - One team reports “flip it on” success in .NET 8 with significant memory reduction.
- Another anecdote: a hobby app runs ~4× faster on .NET 10 vs .NET 8, with many of the article’s optimizations applying.
WebAssembly, WASMGC, and .NET
- Some lament that .NET GC choices diverge from WASMGC, making C# in the browser less viable.
- Others argue:
- .NET was already incompatible with WASMGC MVP (e.g., internal pointers), so .NET 10 doesn’t materially change that.
- A specialized .NET runtime for WASMGC remains possible.
- Broader debate over whether WebAssembly has “taken off” in browsers, with examples (Sheets, Prime Video, Blazor) vs claims it remains niche outside high-performance apps; tooling and developer dislike of JavaScript are recurring themes.
Benchmarking and Licensing History
- Older Microsoft EULAs did restrict publishing .NET Framework GC benchmarks.
- Today’s runtime is MIT-licensed; commenters agree these historical restrictions no longer apply, and cross-runtime benchmarks are now fine.
GC Abstractions vs Complexity
- Some criticize that “you don’t have to care about memory” is oversold, given the depth of GC tuning docs.
- Others respond:
- Defaults work well for ~98% of typical apps; tuning and advanced docs exist primarily for extreme latency/heap scenarios.
- Even manual allocators in C/C++ often require specialized replacements; GC is the trade-off for avoiding memory bugs.
- It’s noted that .NET even allows pluggable standalone GC implementations for extreme needs.
C#, F#, and Programming Style
- Many praise C#/.NET as one of the best cross-platform GC environments (performance, ecosystem, tooling).
- Counterpoints:
- C# and typical .NET frameworks encourage “implicit magic” (attributes, reflection, DI, source generators), which can hurt observability and debugging.
- Some prefer Go or Python for their explicit, opinionated styles; others point out you can write explicit, mostly functional C# if you choose.
- F# is repeatedly highlighted as:
- Sharing the same runtime, benefiting from all GC improvements.
- Offering better ergonomics and stronger functional tooling (pattern matching, discriminated unions, type inference), though community size and hiring are concerns.
- Long subthread debates FP vs OOP:
- FP advocates emphasize ergonomics, correctness, and ease of reasoning; others note steep learning curves and limited adoption.
- Result/option types (e.g.,
ErrorOr<T>, OneOf) and pattern matching are used in C# to emulate checked errors and functional style, but many developers prefer exceptions.
.NET Tooling and Cross-Platform Experience
- Multiple comments confirm modern .NET runs smoothly on Linux in production; many shops develop on Windows/macOS and deploy to Linux.
- Opinions differ on tooling:
- Some see Visual Studio / Rider as excellent, with solid debugging and cross-project navigation.
- Others, especially VS Code users, complain about Roslyn crashes, awkward navigation, SourceLink not working reliably, and DI/extension-method-based configuration being opaque.
UI Frameworks: MAUI, Avalonia, and Alternatives
- Significant skepticism around .NET MAUI:
- Seen as unstable, under-resourced, and not widely used even by Microsoft; frequent regressions reported.
- Some C# devs prefer Flutter or React Native for mobile; one team’s systematic comparison concluded Flutter was far more productive and polished.
- Avalonia gets frequent recommendations for desktop (true cross-platform, better long-term prospects than MAUI), with caveats like weak WebView support.
- Other approaches:
- WinForms/WPF still used for Windows-only.
- MAUI Blazor Hybrid and pure Blazor/“Tauri-like” models for desktop via web UIs.
- MVVM frameworks like MvvmCross with fully native UIs (plus AI-assisted cross-platform UI generation) for more control and stability.
Performance-Sensitive Domains and LINQ
- Question whether .NET is now viable for high-frequency trading:
- Some say it has been for years; in many financial domains GC languages already meet “fast enough” latency with better iteration speed than C++.
- Benchmarks show C# close behind C/C++/Rust in many synthetic tasks, especially when using unsafe code and intrinsics where needed.
- JIT–GC interaction:
- Discussion that JIT and GC are naturally synergistic (escape analysis, stack allocation, read/write barriers).
- Commenters note how hard full lifetime modeling is in practice; escape analysis must be bounded to avoid undecidability.
- LINQ:
- One side says LINQ already includes internal optimizations and shouldn’t be JIT-special-cased.
- Others point out that, without escape analysis and devirtualization, LINQ incurs iterator, closure, and delegate allocations; .NET 10’s new escape analysis could substantially reduce this overhead in hot paths.
Overall Sentiment
- Broad enthusiasm for .NET 10’s GC and JIT improvements, particularly stack allocation and reduced allocations, with some real-world wins already observed.
- Persistent concerns around:
- Stack overflow risk in pathological code.
- WebAssembly integration, MAUI stability, and ecosystem “magic.”
- The thread reflects a split between those who see modern .NET/C# as a high-water mark for managed runtimes and those who increasingly favor more explicit, less magical stacks for large teams.