What's new in the .NET 11 runtime
254 points
• 2 days ago
• Article
Link
.NET 11 runtime 引入了旨在增强性能、简化代码维护并优化开发者体验的重要更新。其中一项主要变化是提高 x86/x64 和 Arm64 架构的最低硬件要求:现在它们需要更现代的指令集。这种调整通过放弃对旧版硬件的支持来精简代码库,从而实现与当前操作系统标准一致的更优化代码生成。
预览阶段的一项重点功能是 Runtime Async,它将模型从编译器生成的状态机转向由 runtime 管理。该更新通过取消对编译器输出基础设施的依赖,带来更清晰的实时堆栈跟踪、更好的可调试性,并降低开销。 runtime 现在能够原生处理异步挂起与恢复,并借助缓存延续以及延续可选择不捕获不必要的 ExecutionContext 等能力进一步提升性能,从而减少高吞吐量异步代码中的开销。
Just-In-Time(JIT)编译器同样获得了显著改进,从更积极的边界检查消除到对泛型虚拟方法的更好去虚拟化。这些增强再加上用于 SIMD 通道构建与组合的新硬件指令,使执行效率更高。 runtime 现在还可以在不依赖平台特定代码的情况下,对向量元素布局进行更精细的控制,这对图像处理和数字信号处理工作负载尤为有利。
基础设施和诊断方面也新增了多项关键能力,包括一种新的进程内崩溃报告机制,可在进程终止前捕获关键状态信息。通过允许 runtime 在逻辑处理器超过 1024 的系统上初始化,高核心数服务器的支持得到改进。另外,NativeAOT 通过为接口方法调用提供共享分发辅助程序来提升性能,减少二进制体积并提高吞吐量。
最后,这次更新还针对特定平台和场景带来了明显优化。 WebAssembly 支持现在提供更便捷的 WebCIL 有效载荷加载,并提升了互操作性能;iOS 和 tvOS 上的文件锁定行为也已更新,避免应用在后台挂起期间被终止。与此同时,ReadyToRun(R2R)镜像现在配备了专门的默认比较器,以加速集合操作。再加上多项可靠性修复,确保 .NET 11 为现代应用程序开发提供更坚实、更高效的基础。
The .NET 11 runtime introduces significant updates aimed at enhancing performance, simplifying code maintenance, and refining the developer experience. One of the primary changes is an increase in minimum hardware requirements for x86/x64 and Arm64 architectures, which now demand more modern instruction sets. This shift streamlines the codebase by moving away from legacy hardware support, allowing for more optimized code generation that aligns with current OS standards.
A major feature arriving in preview is Runtime Async, which transitions from compiler-generated state machines to a runtime-managed model. This update results in cleaner live stack traces, improved debuggability, and lower overhead by eliminating the need for compiler-emitted infrastructure. The runtime now handles asynchronous suspension and resumption natively, and performance is further boosted by features like cached continuations and the ability for continuations to opt out of unnecessary ExecutionContext capture, which reduces overhead in high-throughput async code.
The Just-In-Time (JIT) compiler has also received substantial improvements, ranging from more aggressive bounds check elimination to better devirtualization of generic virtual methods. These enhancements, coupled with new hardware intrinsics for SIMD lane construction and composition, allow for highly efficient execution. The runtime now provides finer control over vector element layout without relying on platform-specific code, which is particularly beneficial for image processing and digital signal processing workloads.
Infrastructure and diagnostics have been bolstered through several key additions, including a new in-process crash reporting mechanism that captures vital state information before a process terminates. Support for high-core-count servers has been improved by allowing the runtime to initialize on systems with more than 1024 logical processors. Additionally, NativeAOT has seen performance gains through shared dispatch helpers for interface method calls, reducing binary sizes and improving throughput.
Finally, the update brings notable refinements for specific platforms and scenarios. WebAssembly support now includes easier loading of WebCIL payloads and improved interop performance. Meanwhile, file locking behaviors on iOS and tvOS have been updated to prevent app termination during background suspension, and ReadyToRun (R2R) images now feature specialized default comparers to speed up collection operations. These changes, alongside various reliability fixes, ensure that .NET 11 provides a more robust and efficient foundation for modern application development.
1 comments • Comments Link
• 对于现代后端开发来说,C# 和 .NET 高效且可靠,提供稳定一致的工具链、强大的静态分析能力,以及在不少企业场景中足以媲美甚至超越 Go 的出色性能。
• 尽管人们仍会提起"Microsoft baggage",源于对遗留 .NET Framework 和被淘汰的 UI 技术的历史印象,但现代 .NET Core/.NET 5+ 从根本上解决了许多这类问题,搭起了稳健的跨平台生态。
• AI 开发与 C# 的结合非常契合,这得益于其类型安全、工具完备,以及借助 Roslyn analyzers 和 source generators 的能力,并通过 DI 容器为 agent 提供对运行中应用的深度内省。
• Go 常被称赞其简洁性以及静态二进制部署的便利,但它在表达能力、丰富的抽象特性(如 LINQ 和 advanced generics)以及"batteries-included"式的内置框架方面,不及 C# 。
• 开发者普遍认为,.NET 的快速发布节奏和持续演进(例如 NativeAOT 、 Span<T>,以及即将推出的 runtime async 增强能力)让它成为更具前瞻性的选择,哪怕它在品牌层面仍承受一些负面印象。
• F# 仍是这个生态中尚未被充分利用的资产。它提供了更简洁、更函数式的路径,即便对于没有深厚函数式经验的团队,在面向 AI 的代码库中也能发挥特别的优势。
• 桌面端 UI 开发依旧是 .NET 生态的一大痛点。由于 Microsoft 在 WinForms 、 WPF 、 UWP 和 MAUI 之间不断调整策略,形成了较为碎片化的局面,促使不少人转向 Avalonia 等第三方方案。
• 两年一次的发布与支持生命周期需要持续投入维护。有人觉得这很有挑战,也有人认为这是为了换取在新版本中引入的创新步伐与性能提升而必须承担的代价。
• 与 C# 相比,许多人认为 Go 在 TypeScript compiler 等内部工具上的投入属于错失机会。这也凸显:即便 C# 技术上完全胜任,在开源采用率和受欢迎程度等方面,它仍要面对比起与语言无关、由社区驱动的生态系统更不占优势的现实。
• 现代 C# 已经演化成一种极具表现力的语言,它在高级生产力与底层控制之间搭起桥梁,因此既适用于 web 后端,也能胜任性能关键型算法与企业级集成,堪称"什么都能做"的通用语言。
整体讨论反映出一种强烈共识:现代 .NET 是功能强大且性能出色的生态系统,却常因人们对其"legacy 仅限 Windows"的旧印象而遭受不公正的指责。尽管 Go 经常以二进制体积小、部署简单来与 C# 对标,但 C# 的支持者认为,它在抽象能力、库支持以及工具链方面更有优势,更利于长期的企业维护。平台稳定、不可轻易改变的诉求与技术快速演进的现实之间,存在反复出现的张力:Microsoft 激进的发布节奏既因持续创新而受到称赞,也因频繁升级带来的负担而遭到批评。归根结底,C# 被看作是后端服务与 AI 集成应用的强力引擎,尽管其桌面 UI 策略的碎片化,以及在开源社区争取关注度方面的持续困难,仍是更广泛采用的主要障碍。 • C# and .NET are highly effective for modern backend development, offering a stable, consistent toolchain, strong static analysis, and excellent performance that rivals or exceeds Go in many enterprise scenarios.
• The "Microsoft baggage" perception persists due to historical experiences with legacy .NET Framework and abandoned UI technologies, yet modern .NET Core/.NET 5+ has fundamentally resolved many of these issues, creating a robust, cross-platform ecosystem.
• AI development integrates well with C# due to its type safety, rich tooling, and the ability to use Roslyn analyzers and source generators to provide agents with deep introspection into the running application via DI containers.
• While Go is often praised for simplicity and static binary deployment, it lacks the expressive power, rich abstraction features (like LINQ and advanced generics), and built-in "batteries-included" frameworks found in C#.
• Developers highlight that .NET's rapid release cycle and consistent improvements—such as NativeAOT, Span<T>, and upcoming runtime async enhancements—make it a forward-looking platform despite a perceived branding problem.
• F# remains an underutilized asset within the ecosystem, offering a more concise, functional approach that is particularly effective for AI-generated codebases, even for teams without deep functional programming experience.
• Desktop UI development remains a significant pain point in the .NET ecosystem, as Microsoft's shifting strategy across WinForms, WPF, UWP, and MAUI has left a fragmented landscape, leading many to adopt third-party alternatives like Avalonia.
• The two-year release and support lifecycle requires consistent maintenance, which some developers find challenging, yet others view as a necessary trade-off for the pace of innovation and performance gains introduced in newer versions.
• The preference for Go over C# for internal tools like the TypeScript compiler is viewed by many as a missed opportunity, emphasizing that while C# is technically capable, it struggles with open-source adoption and popularity compared to language-agnostic or community-driven ecosystems.
• Modern C# has evolved into a highly expressive language that bridges high-level productivity with low-level control, making it a "do-it-all" language suitable for web backends, performance-critical algorithms, and enterprise integration.
The discussion reflects a strong consensus that modern .NET is a highly capable and performant ecosystem, often unfairly maligned by lingering perceptions of its "legacy" Windows-only past. While Go is frequently contrasted with C# regarding binary size and deployment simplicity, proponents of C# argue that the latter offers superior abstraction, better library support, and a more robust tooling story for long-term enterprise maintenance. A recurring tension exists between the desire for a stable, unchanging platform and the reality of rapid technological advancement, with Microsoft's aggressive release cadence receiving both praise for constant innovation and criticism for the burden of frequent upgrades. Ultimately, C# is viewed as a powerhouse for backend services and AI-integrated applications, though its fractured desktop UI strategy and struggles to gain mindshare in the open-source community remain significant hurdles for broader adoption.