.NET 9.0 is now released and comes with performance improvements, support and more

.NET 9.0

Microsoft unveiled the New version of «.NET 9» released an open platform that unifies previously separate products such as .NET Framework, .NET Core, and Mono. NET 9.0 introduces a number of performance improvements, compiler optimizations, runtime enhancements, and more.

One of the most important changes in .NET 9.0 is the modernization of the garbage collector, that now implements a dynamic adaptation mechanism to the size of the application. This means that the collector is not tied to the amount of resources available on the system, but to the amount of memory the application needs.

In addition, there have been optimizations in the JIT compiler, with the incorporation of new profile-based optimizations (PGO), improvements in loop handling and inline unrolling, and an exception handling optimization that increases speed by 50%. Code with streaming operators has seen performance improvements of up to 70%, and improvements have also been made to LINQ query performance, especially in the Take and DefaultIfEmpty methods when working with empty arrays and collections, achieving improvements of up to 10x in some cases.

With regards to System.Text.Json library, has been significantly improved performance and efficiency. The method JsonProperty.WriteTo is now able to write UTF8 strings directly, Removing unnecessary memory allocation, resulting in a 15% improvement in performance and a 93% reduction in memory consumption in benchmark tests against .NET 8.

El Runtime also introduces a new attribute model allowing activate and deactivate functions in libraries more efficiently. In the language C# 13, the capabilities of the «params» modifier have been expanded, allowing not only the use of arrays, but also collections.

A "^" operator has also been introduced to specify indexes from the end of an array, making array manipulation easier. Additionally, asynchronous iterators and methods that can use ref-safe and unsafe expressions are allowed. Finally, a new type of lock has been proposed to improve handling of multithreaded applications.

Version F# 9 has support for nullable types, which expands language capabilities. In addition, Unions now implement «.Is*» properties generated automatically, making it easy to check whether a value belongs to a specific set. For example, with joins, you can check values ​​like person.contact.IsEmail.

In the Directives starting with the # symbol are now allowed to accept non-string values. The ability to randomly select or shuffle elements has also been added in modules such as List, Array, and Seq. Collection operations have also been improved, allowing for easier working with lists and sets.

On the other hand, the battery .NET Aspire now offers a more robust set of components for building applications in cloud environments. This includes new capabilities to manage the lifecycle of applications and resources, as well as improvements to telemetry collection tools.

As for the C#, a set of new abstractions has been proposed for facilitate the development of artificial intelligence applications. These abstractions include the use of large language models, access to vector stores and interactions with AI services.

Also A new Tensor type has been introduced and methods for calculating and manipulating multidimensional data, along with plugins. The ML.NET update also includes improvements, with the new Microsoft.ML.Tokenizers library for encoding and decoding text into tokens.

For web development, ASP.NET Core has improved its build support, offering a Better performance, lower memory consumption and faster startup times. Work with static files has also been optimized, and a new API for authentication and authorization has been included. Blazor, the platform for creating web applications with C#, has launched new templates for both web and hybrid applications, expanding the possibilities for developers.

MAUI (Multi-platform App UI) has improved performance and integration with applications desktop and mobile. New interface elements such as TitleBar and HybridWebView have been added, making it even easier to create interactive user applications.

Lastly, WPF (Windows Presentation Foundation) has increased its compatibility with themes, adding support for accent colors, allowing developers to further customize the look and feel of their Windows applications.

Finally, if you are interested in being able to know more about it, you can consult the details in the following link