Announcing .NET 5.0 Preview 7
Today, we’re releasing .NET 5.0 Preview 7. It’s the second to last of the preview releases (before moving to RC). Most features should be very close to done at this point. Single file and ARM64 intrinsics are two feature areas that are taking the longest time to complete, but are on track for Preview 8. See the .NET 5.0 Preview 4 post for a broader view of the release.
You can download .NET 5.0 Preview 7, for Windows, macOS, and Linux:
Stephen Toub recently posted his Performance Improvements in .NET 5 post, the latest in his series. He covers ~250 performance-oriented pull requests, which reveal improvements that will even surprise people who follow .NET Core performance closely.
We’ve been adding usability feature to the new JSON API. The following features are new in Preview 7 (more coming in Preview 8, too).
- [Breaking change] Ability to ignore default values for value-type properties when serializing — can be used to reduce serialization and wire costs.
- Ability to handle circular references when serializing — API shape is now expected to be final.
Garbage Collection (GC)
The GC now exposes detailed information of the most recent collection, via the GC.GetGCMemoryInfo method, which returns a GCMemoryInfo struct. 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
changes in policy to lower the GC latency (and GC CPU usage in general).
RyuJIT is the assembly code generator for .NET, target both Intel and ARM chips. Most of the investment in RyuJIT is focused on performance.
- General Improvements
- Enable eliding some bounds checks — Credit @nathan-moore
- Optimize Enum.CompareTo after being rewritten in C# — performance is now at parity with previous C++ implementation.
- Improvement in register allocation for structs — Enregister multireg lclVars
- Improvements for removal of redundant zero inits
- Tail duplication improvement
- Stack based structs copy CQ fix
- Clean up a dead field assignment after removing redundant zero initializations
- ARM64 hardware intrinsics & API optimization
- Implement majority of “by element” intrinsics
- Implement fcvtxn, fcvtxn2, sqabs, sqneg, suqadd, usqadd intrinsics — #38010, #38110
- Optimize SpanHelpers.IndexOf(byte), SpanHelpers.IndexOf(char)
- Optimize SpanHelpers.IndexOfAny(byte)
- Optimize WithLower, WithUpper, Create, AsInt64, AsUInt64, AsDouble
- Optimize AsVector, AsVector128, GetUpper, As and WithElement
Please tell us about your experience using Preview 7. It’s not too late to share your feedback. We are getting close to the end of the release, but are actually more focused on quality now since we are largely done with feature development.
After Preview 8, we plan to release two RCs before the final release. The RCs will have “go live” licenses, meaning they’ll be supported in production. On that note, we’ve been running the dot.net site on .NET 5.0 since Preview 1 (50% on 5.0; 50% on 3.1) and it has worked great.