Garbage collector improvements
The .NET garbage collector now allows you to adjust memory limits dynamically for cloud-native applications, especially those running on Kubernetes. This feature will be particularly helpful in scenarios where services are hosted in a cloud environment.
JSON enhancements
Several enhancements have been made to the JSON serialization and deserialization functions in .NET. This includes support for floating-point hardware and support for new numeric types like half structs.
Further, when deserializing data in earlier versions of .NET, any property in your JSON paytload that isn’t a POCO type would be ignored. With .NET 8, you can make all data members available in the JSON payload.
Time abstraction
The newly added TimeProvider class and ITimer interface provide time abstraction functionality, thereby allowing you to mock time in test scenerios. The time abstraction functionality provides support for the following:
- Create a new timer instance
- Retrieve local time or UTC time
- Retrieve a timestamp for measuring performance
The TimeProvider abstract class is designed in a way that makes it suitable for integration with mocking frameworks, providing methods that facilitate seamless and comprehensive mocking of all its aspects.
Cryptography enhancements
As cyber threats proliferate globally, new support for SHA-3 support makes .NET 8 applications more secure, providing an alternative to SHA-2. Also in .NET 8, the RSA ephemeral operations have been moved to bcrypt.dll rather than ncrypt.dll, avoiding the need to make a remote procedure call to lsass.exe.
Compression enhancements
Compressing files from a directory using a stream is now possible without having to cache them. This allows direct memory management of the compression result. When disk space is limited, these APIs become useful because they eliminate the need for intermediate disk operations.
Native AOT compilation improvements
Support for native ahead-of-time (AOT) compilation was first introduced in .NET 7. With .NET 8, Microsoft has added native AOT support for x64 and Arm64 architectures on macOS, and has significantly reduced the size of native AOT applications running on Linux.
Source https://www.infoworld.com/article/2335555