.NET 6 Preview 3 Is Out

Preview 3 is dedicated almost entirely to low-level performance features.

Recently, Microsoft announced the release of .NET 6 Preview 3. 

According to Microsoft Preview 3 is dedicated almost entirely to low-level performance features. Low-level performance feature improvements are not necessarily always fully appreciated by many users, but they help a lot for many apps. The majority of these improvements apply to the CLR type system directly, either making it function faster or better interplay with modern CPUs. 

In recent past years, there have been a few important performance trends with .NET, including using structs more liberally in libraries, and moving runtime code to C#. Both trends are visible in these changes. The release also demonstrates continued efforts on a focused set of performance strategies.

For EF Core, this release includes a bunch of bug fixes and ongoing enhancements to infrastructure to support upcoming features including compiled models and temporal tables.

The company recommended Visual Studio 16.10 Preview 1 and Visual Studio for Mac 8.9. to try .NET 6. 

.NET 6 official release will be rolled out in November 2021, and will be supported for three years, as an LTS release. In .NET 6, the platform matrix has been significantly expanded, the additions include Android; iOS; Mac and Mac Catalyst, for x64 and Apple Silicon (AKA “M1”); and Windows Arm64 (specifically Windows Desktop).

This release adds a new unsafe api — CollectionsMarshal.GetValueRef — that makes updating struct values in Dictionaries faster. This API is intended for high-performance scenarios(not for general purpose use). CollectionsMarshal.GetValueRef returns a ref to the struct value which can then be updated in place with typical techniques.

Source: Microsoft

The release also features faster interface checking and casting(upto 38%). This enhancement is specifically useful for C#’s pattern matching to and between interfaces.

Well, early support for .NET Hot Reload is also now available for ASP.NET Core & Blazor projects using dotnet watch.  Hot Reload implements code changes to running app without restarting it and without losing any app state. And, code changes that cannot be applied to the running app can still be done by rebuilding and restarting the app.

For additional details, you can visit the official announcement here.