6

.NET 7 framework update focuses on improved performance

 1 year ago
source link: https://devm.io/dotnet/dot-net-7-framework
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

New update for the Microsoft development framework arrives

.NET 7 Framework Update Focuses on Improved Performance

Sarah Schlothauer

09. Nov 2022


On November 8, 2022 Microsoft announced that the latest version of .NET is now available to download. .NET 7 arrives with over 28,000 contributions from the community and is available for free for Windows, macOS, and Linux devices.

.NET is a widely used open source development framework for Microsoft languages, including C#, that assists developers in building cross-platform applications that will run natively on any operating system.

Let’s take a look at some of the newest changes in .NET 7.

Heightened performance

According to Microsoft’s announcement blog post, .NET 7’s main goals were to deliver something unified, modern, simple and highly performant that can be used with cloud native applications.

.NET 7 enhances performance in a number of ways, including:

  • ARM64: Improved library performance thanks to cross-platform helpers, runtime improvements, and better MicroBenchmarks. Better support on Linux devices
  • .NET now runs natively on IBM Power
  • Mono runtime performance improvements for Blazor
  • Native AOT (ahead-of-time) support
  • Improvements for Reflection
  • Faster startup time with On Stack Replacement (OSR)

Generic Math interfaces

Both .NET 7 and the newly released C# 11 now add new math generic interfaces to the base class library.

From the Microsoft developer blog:

The availability of these interfaces means you can constrain a type parameter of a generic type or method to be “number-like”. In addition, C# 11 and later lets you define static virtual interface members. Because operators must be declared as static, this new C# feature lets operators be declared in the new interfaces for number-like types.”

Regular expressions improvements

The regular expressions library receives some new enhancements, which not only improves its performance, but also adds a new RegexOptions.NonBacktracking option. This option allows for matching without any backtracking.

Various improvements and changes

Several first-party libraries have received new improvements and updates, including new nullable annotations for all Microsoft.Extensions. libraries. Additionally, improvements have been made to .NET library APIs.

Support for required members has also been added. Now, the JsonSerializer.Deserialize methods will throw a JsonException if a required property is not present in the JSON payload.

From the documentation for required properties:

There are three ways to mark a property or field as required for JSON deserialization:
By adding the required modifier, which is new in C# 11.
By annotating it with JsonRequiredAttribute, which is new in .NET 7.
By modifying the JsonPropertyInfo.IsRequired property of the contract model, which is new in .NET 7.

.NET 7 is not the only new addition from Microsoft. It also arrives alongside new updates for .NET MAUI, Blazor, and the Upgrade Assistant, which helps users migrate their legacy applications and update older, outdated codebases. Using the .NET Upgrade Assistant, you can incrementally modernize older applications built with the .NET framework, step-by-step, with full hands-on control.

Users can already download the newest version. However, although .NET 7 includes the newest features and is the recommended option, it has standard support, meaning it will receive support from Microsoft for 18 months. .NET 6 is still the long term support (LTS) version. LTS versions of .NET 6 will receive free support for three years after its release—until November 12, 2024.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK