Microsoft details .NET 6 performance boosts


.NET 6, the planned upgrade to Microsoft’s software development platform, boasts performance improvements in areas ranging from just-in-time (JiT) compilation and garbage collection (GC) to JSON, according to Microsoft.

In a lengthy blog post published August 17, Steven Toub, a developer on the .NET team at Microsoft, surveyed the many performance improvements in .NET 6. Toub noted the JiT has an “unbelievable number” of performance improvements, impacting aspects such as inlining, which is the process by which the compiler takes code from a method callee and emits it into the caller. By exposing the contents of the callee to the context of the caller, inlining enables “knock-on” optimizations that wouldn’t otherwise be possible.

The JiT is used to translate IL (intermediate language) into assembly code at run time; it also is used for ahead-of-time compilation as part of CrossGen2 code optimization and the R2R format (ready to run).

For garbage collection, .NET 6 has benefited from a lot of work on switching the GC implementation to be based on regions, rather than segments. Regions are smaller units of memory, enabling better GC performance.

Performance enhancements also have been made to system types, such as with Guid, which is used to provide unique identifiers for a number of operations. A new System.Text.Json source generator boosts performance as well. The FileStream type has been rewritten, fixing I/O performance issues.

Other improvements that may make it into .NET 6 include support for Transport Layer Security (TLS) session resumption on Linux, which could shorten the time required to establish secure connections, and more aggressive use of spans throughout the implementation of BigInteger.

Expected to reach production release status in November, .NET 6 has undergone seven beta previews, with a release candidate stage due next. .NET 6 is intended to complete the unification of Microsoft’s .NET technologies, creating a single .NET from the separate .NET Core, .NET Framework, and Xamarin/Mono.