Benchmarks indicate big performance improvements in .NET 6

Martin Brinkmann
Aug 18, 2021
Development
|
6

The upcoming next major version of Microsoft .NET, .NET 6, improves performance of many operations significantly according to Microsoft's benchmark tests.

A new post on the Dotnet developer blog by Stephen Toub,
Partner Software Engineer, .NET, offers insights on the benchmark tests and the performance improvements compared to previous versions of .NET.

According to the post, about 6500 merged pull requests landed in .NET 6, excluding automated pull requests by bots. Of these, about 550 improve performance in one area or another, according to Microsoft.

The post is technical in nature; it contains a lot of code, examples and instructions to run the benchmark to verify the results. BenchmarkDotNet was used for the majority of results.

As examples, here are the benchmark results of Just In Time benchmark tests. Most tests compare the performance of .NET 6.0 with .NET 5.0, but you find other .NET versions used in some of the tests as well.

Method Runtime Mean Ratio Code Size
Format .NET 5.0 13.21 ns 1.00 1,649 B
Format .NET 6.0 10.37 ns 0.78 590 B
Method Runtime Mean Ratio Code Size
Find .NET Framework 4.8 115.4 us 1.00 127 B
Find .NET Core 3.1 69.7 us 0.60 71 B
Find .NET 5.0 69.8 us 0.60 63 B
Find .NET 6.0 53.4 us 0.46 57 B
Method Runtime Mean Ratio Code Size Allocated
GetLength .NET Framework 4.8 6.3495 ns 1.000 106 B 32 B
GetLength .NET Core 3.1 4.0185 ns 0.628 66 B
GetLength .NET 5.0 0.1223 ns 0.019 27 B
GetLength .NET 6.0 0.0204 ns 0.003 27 B
Method Mean Code Size
PGO Disabled 1.905 ns 30 B
PGO Enabled 0.7071 ns 105 B
Method Runtime Mean Ratio Code Size
Sum .NET 5.0 471.3 us
1.00
 54 B
Sum .NET 6.0
350.0 us
0.74
97 B
Method Runtime Mean Ratio Code Size
GetHeight .NET 5.0 151.7852 ns 1.000 179 B
GetHeight .NET 6.0 0.0000 ns 0.000 12 B
Method Runtime Mean Ratio Code Size
Format .NET 5.0 87.71 ns 1.000 154 B
GetHeight .NET 6.0 51.88 ns 0.59 100 B

You can check out the full blog post at the Dot Net Dev Blog for a full rundown of all tests, code examples, and explanations why performance improved for a particular benchmark test.

Developers interested in .NET may download the latest preview release, .NET 6.0 Preview 7 at the time of writing, from Microsoft's Developer website. It is available for Windows (ARM, x64, x32), Linux (Arm32, Arm64, x64) and Mac OS X (Arm64, x64). Only binaries provided for Linux, installers and binaries for Windows and Mac OS.

Now You: do you use applications that require .NET?

Summary
Article Name
Benchmarks indicate big performance improvements in .NET 6
Description
The upcoming next major version of Microsoft .NET, .NET 6, improves performance of many operations significantly according to Microsoft's benchmark tests.
Author
Publisher
Ghacks Technology News
Logo
Advertisement

Previous Post: «
Next Post: «

Comments

  1. TAFF said on September 7, 2021 at 10:05 am
    Reply

    As always, awesome! Thanks for these .NET posts!

  2. DrKnow said on August 18, 2021 at 11:55 pm
    Reply

    Real world scenarios no one will notice.

    1. JStevens said on December 24, 2021 at 7:03 pm
      Reply

      Every optimization helps applications appear snappier. Its subtle in most cases, very noticeable in others. I know Java was bragging that they ran just a few percent faster; I’m not sure that’s true anymore. I’ll upgrade to .NET 6 just on performance improvements alone.

  3. John G. said on August 18, 2021 at 4:40 pm
    Reply

    When will be W10 or W11 realeased with NET 6.0 inside? Any way to upgrade it from 4.8 to 6.0? :[

    1. ULBoom said on August 19, 2021 at 3:21 pm
      Reply

      It’ll be installed separately similar to all the Visual C++ versions you may have, depending on whether they’re needed, which can be seen in Programs and Features. If you click Turn Windows and Features on and off, the first entry is dotNet’s.

      Follow the link Martin provided and nightlys can be downloaded.

    2. beemeup5 said on August 19, 2021 at 7:48 am
      Reply

      There is no path from 4.8 to 6.0.

      4.8 will be the last .NET Framework release. .NET 6 (formerly .NET Core) represents an entirely new development paradigm for Microsoft. The biggest takeaway with .NET 6 is that Microsoft has gone all-in on cross-platform development. Now any programs developed with .NET 6 can be easily compiled for Mac, Linux, even Android and iOS. .NET 5 laid a lot of the groundwork for this to happen but .NET 6 is when the new era officially begins. There is no better time to be a C# programmer than now.

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.