.NET 5 Preview 7


Here are some of the improvements in Preview 7.

Performance

Stephen Toub recently posted his Performance Improvements in .NET 5 post, the latest in his series. He covers around 250 performance-oriented pull requests, which reveal improvements that will even surprise people who follow .NET Core performance closely.

System.Text.Json

The usability feature was added to the new JSON API, and the following features are new in Preview 7.

Garbage Collection (GC)

The GC now exposes detailed information of the most recent collection via the GC.GetGCMemoryInfo method, which returns a GCMemoryInfo struct.

  • The GCMemoryInfo provides information about machine memory, heap memory, and the most recent collection, or most recent collection of the kind of GC you specify ephemeral full blocking, or background GC.
  • The most likely use cases for using this new API are for logging/monitoring or to indicate to a loader balancer that a machine should be taken out of rotation to request a full GC.
  • It could also be used to avoid container hard-limits by reducing the size of caches.
  • Another small but impactful change was made to defer the expensive reset memory operation to low-memory situations.
  • We expect these policy changes to lower the GC latency (and GC CPU usage in general).

RyuJIT

RyuJIT is the assembly code generator for .NET, target both Intel and ARM chips. Most of the investment in RyuJIT is focused on performance.

ASP.NET Core

The following updates are available in Preview 7.

  • Blazor WebAssembly apps now target .NET 5
  • Updated debugging requirements for Blazor WebAssembly
  • Blazor accessibility improvements
  • Blazor performance improvements
  • Certificate authentication performance improvements
  • Sending HTTP/2 PING frames
  • Support for additional endpoints types in the Kestrel sockets transport
  • Custom header decoding in Kestrel
  • Other minor improvements