New C# (.NET 9) Release: What Has Changed
The Microsoft team has officially released the long-awaited .NET 9 platform update, which brings a number of significant improvements to the C# programming language. This release marks an important step in the evolution of the ecosystem, aimed at improving performance, simplifying development, and expanding capabilities for modern applications. Let's look at the key innovations that will be of interest to both experienced developers and those just starting to learn C#.
Key Changes in C# 13
The new release introduced language version C# 13, which includes several long-awaited syntax improvements:
- Partial properties and indexers — you can now split the implementation of properties and indexers across multiple files, simplifying work with large classes and code generation.
- New collections in pattern matching — improved pattern matching for arrays and lists, including support for slices and ranges. This allows for writing more concise and readable code.
- Improved ref struct support — added the ability to declare ref fields in structs, opening new ways to optimize memory management and reduce garbage collector load.
Performance: A New Level
One of the main goals of .NET 9 was performance improvement. Microsoft developers have implemented a number of optimizations in the JIT compiler (Ryujit) and runtime:
- Faster LINQ queries — many standard operations such as
Where,Select,Sumhave received additional optimizations at the machine code level. In benchmarks, the execution speed of some queries has increased by 20-30%. - Improved AOT compilation (Native AOT) — native code compilation technology has become more stable and faster. AOT now supports more application types, including ASP.NET Core and gRPC services. This is especially important for cloud and container scenarios where fast startup is critical.
- New profiler — built-in diagnostic tools have been updated to more accurately identify bottlenecks in code.
New Capabilities for Web and Cloud Development
.NET 9 is also focused on modern development scenarios:
- ASP.NET Core — improved work with Blazor (including hybrid applications) and SignalR. Built-in support for OpenAPI v3.1 for automatic documentation generation has been added.
- gRPC and HTTP/3 — significantly improved performance of gRPC services, as well as enhanced support for the HTTP/3 protocol for faster and more secure connections.
- AI tools — new libraries for integration with machine learning models have been introduced, simplifying the creation of intelligent features in applications.
What Does This Mean for Developers?
The new C# (.NET 9) release is not just a set of fixes, but a serious step forward. Developers get a faster and more secure stack for creating any type of application: from desktop (WPF, WinUI) to web services and microservices. Particularly noteworthy are the improvements in AOT compilation, which make C# even more attractive for high-load systems and