Microsoft’s .NET 11 Preview 2 affords cleaner stack traces

Microsoft has revealed Preview 2 of its deliberate .NET 11 software program improvement platform, emphasizing progress starting from native runtime async to smaller SDK installers for Linux and macOS.

Launched March 10, .NET 11 Preview 2 will be downloaded from web.microsoft.com. Preview 2 follows the February 10 launch of Preview 1, with the manufacturing launch anticipated in November.

Preview 2 brings important progress towards runtime-native async, in response to Microsoft. As a substitute of the compiler producing state-machine lessons, the runtime itself manages async suspension and resumption. This produces cleaner stack traces, higher debugging, and decrease overhead. However runtime async remains to be a preview characteristic. The compiler should emit strategies with MethodImplOptions.Async for the runtime to deal with them as runtime-async.

Additionally within the runtime, the JIT now eliminates bounds checks for the frequent sample the place an index plus a relentless is in contrast in opposition to a size. Checked arithmetic contexts which are proved redundant are additionally optimized away.

For the SDK, the installer dimension on Linux and macOS has been decreased by deduplicating assemblies utilizing symbolic hyperlinks. Duplicate .dll and .exe recordsdata are recognized by content material hash and changed with symbolic hyperlinks pointing to a single copy. This impacts tarballs in addition to .pkg, .deb, and .rpm installers

Code analyzer enhancements had been made within the SDK to keep away from doubtlessly costly logging. Property accesses, GetType(), GetHashCode(), and GetTimestamp() calls now not are flagged. Diagnostics now solely apply to Data-level and beneath by default, since warning/error/vital code paths are not often sizzling paths. And diagnostic messages now embrace why an argument was flagged, serving to builders prioritize which warnings to handle.

New within the .NET 11 libraries, overloads on TarFile.CreateFromDirectory settle for a TarEntryFormat parameter, giving direct management over the archive format (dotnet/runtime#123407). Beforehand, CreateFromDirectory produced Pax archives. The brand new overloads help all 4 tar codecs—Pax, Ustar, GNU, and V7—for compatibility with particular instruments and environments.

Included in .NET 11 Preview 2 are the next further enhancements:

  • Efficiency enhancements in ASP.NET Core have Kestrel’s HTTP/1.1 request parser now utilizing a non-throwing code path for dealing with malformed requests. As a substitute of throwing BadHttpRequestException on every parse failure, the parser returns a end result struct indicating success, incomplete, or error states. In eventualities with many malformed requests—similar to port scanning, malicious site visitors, or misconfigured shoppers—this eliminates costly exception-handling overhead whereas bettering throughput by as much as 20% to 40%. Legitimate request processing shouldn’t be impacted.
  • The F# language has simplified DIM (Default Interface Member) hierarchies. Additionally with F#,  a preview characteristic (--langversion:preview) caches overload decision outcomes for repeated methodology calls with the identical argument sorts.
  • For map management in .NET MAUI (Multi-platform App UI), new TypeConverter implementations for Location and MapSpan allow concise XAML syntax for map coordinates, eliminating the necessity for verbose x:Arguments markup.  Additionally in .NET MAUI, TypedBinding and SourceGeneratedBinding now are roughly 29% sooner with 50% much less reminiscence allocation per binding operation.
  • Entity Framework (EF) Core helps translating the LINQ MaxByAsync and MinByAsync strategies and their synchronous counterparts. These strategies permit builders to search out the component with the utmost or minimal worth for a given key selector, moderately than simply the utmost or minimal worth itself.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles