Skip to content

.NET 7.0 GA Microbenchmarks Performance Study Report #79245

Description

@dakersnar

Data

This time we have covered following configurations comparing .NET 7.0 vs. .NET 6.0:

  • architectures: arm64, x64, arm
  • Unix: raspbian 11, ubuntu 18.04, macOS 13.0, macOS Monterey 12.6
  • Windows: 10 & 11
Details
Operating SystemBitProcessor Name
Windows 11Arm64Microsoft SQ1 3.0 GHz
macOS 13.0Arm64Apple M1
Windows 10X64Intel Xeon CPU E5-1650 v4 3.60GHz
Windows 10X64Intel Core i7-5557U CPU 3.10GHz (Broadwell)
Windows 10X64Intel Core i7-8650U CPU 1.90GHz (Kaby Lake R)
Windows 11X64AMD Ryzen Threadripper PRO 3945WX 12-Cores
ubuntu 18.04X64Intel Xeon CPU E5-1650 v4 3.60GHz
raspbian 11ArmARMv7 Processor rev 3 (v7l)
macOS Monterey 12.6X64Intel Core i7-5557U CPU 3.10GHz (Broadwell)

Most of the benchmarks were run on bare-metal machines, some were executed via WSL.

This would not be possible without the help from: @adamsitnik, @jozkee, @janvorli, @jeffhandley, @mrsharm, and @cincuranet who contributed their results and time.

The full report generated by the tool is available here. You will have to click "Raw" to see the entire file. The report is sorted from most regressed to most improved, so scroll to the bottom in the full report to see improvements. There are plenty of them!

Again, the full historical data turned out to be extremely useful. For details about methodology please read #41871.

The RC2 vs 6.0 report can be found here. As that report almost acted as a release-to-release comparison, and contains a different spread of configs, it continues to be a valuable resource when evaluating .NET 7 performance.

Improvements

There are too many improvements to individually call out (what a great problem to have!). Instead, I collected the top 300 in an excel document (7.0-GA-Report-Top-300.zip). All high-level analysis of this data should be taken with a grain of salt, and I highly encourage readers to examine the raw data for specifics on individual benchmarks (start at the bottom for improvements). Additionally, the previous report was run with a different set of machines, so it may be worth looking at that data as well.

The most improved grouping of benchmarks was System.Text.RegularExpressions.Tests.Perf_Regex*, making up 103 of the top 300, and 56 of the top 100. Feel free to sort the table A to Z in excel to see other groupings of tests.

Just for fun: the winner of the "most improved benchmark" award is System.Text.RegularExpressions.Tests.Perf_Regex_Industry_RustLang_Sherlock.Count(Pattern: "[a-q][^u-z]{13}x", Options: None), with a staggering 400x improvement.

Details

System.Text.RegularExpressions.Tests.Perf_Regex_Industry_RustLang_Sherlock.Count(Pattern: "[a-q][^u-z]{13}x", Options: None)

ResultRatioAlloc DeltaOperating SystemBitProcessor NameModality
Faster400.11-29756Windows 11Arm64Microsoft SQ1 3.0 GHz
Faster433.10-29646macOS 13.0Arm64Apple M1
Faster463.42-29656Windows 10X64Intel Xeon CPU E5-1650 v4 3.60GHz
Faster464.66-29756Windows 10X64Intel Core i7-5557U CPU 3.10GHz (Broadwell)several?
Faster447.08-29756Windows 10X64Intel Core i7-8650U CPU 1.90GHz (Kaby Lake R)
Faster525.32-29656Windows 11X64AMD Ryzen Threadripper PRO 3945WX 12-Cores
Faster420.86-29608Windows 11X6411th Gen Intel Core i9-11900 2.50GHz
Faster418.30-29756ubuntu 18.04X64Intel Xeon CPU E5-1650 v4 3.60GHz
Faster232.79-18278raspbian 11ArmARMv7 Processor rev 3 (v7l)bimodal
Faster403.98-29756macOS Monterey 12.6X64Intel Core i7-5557U CPU 3.10GHz (Broadwell)

For a more in-depth look at .NET 7 performance improvements, check out Stephen Toub's writeup here: https://devblogs.microsoft.com/dotnet/performance_improvements_in_net_7/. To quote his TL;DR:

.NET 7 is fast. Really fast. A thousand performance-impacting PRs went into runtime and core libraries this release, never mind all the improvements in ASP.NET Core and Windows Forms and Entity Framework and beyond. It’s the fastest .NET ever. If your manager asks you why your project should upgrade to .NET 7, you can say “in addition to all the new functionality in the release, .NET 7 is super fast.”

Thank you to all contributors for making 7.0 the fastest .NET yet!

Regressions

For regressions, this report focused on what was not called out already by the RC2 report. Consider the combination of the two reports to be a total view of .NET 7's regressions compared to .NET 6.

Fixed since RC2

As part of writing this report, I double checked all regressions called out in the previous RC2 report. Assume all issues in the previous report are unresolved unless called out here:

Investigation In Progress

By Design

Noise, Flaky or Multimodal

The following benchmarks showed up in the report generated by the tool, but were not actual regressions:

  • System.Numerics.Tests.Perf_Matrix4x4.IdentityBenchmark
  • System.Numerics.Tests.Constructor.ConstructorBenchmark_SByte
  • System.Buffers.Text.Tests.Utf8FormatterTests.FormatterInt32(value: 4)
    • Might be bimodal, but seems to have been resolved regardless
  • Perf_VectorOf*
    • Had a lot of regressions on the Linux devices we tested. However, there are not enough data points to make a conclusion as these benchmarks are historically noisy.

Statistics

Total: 45809
Same: 57.48 %
Slower: 5.99 %
Faster: 24.58 %
Noise: 11.91 %
Unknown: 0.04 %

Statistics per Architecture

ArchitectureSameSlowerFasterNoiseUnknown
Arm6449.81 %3.62 %35.66 %10.88 %0.03 %
Arm51.72 %9.15 %35.27 %3.79 %0.07 %
X6460.45 %6.20 %19.95 %13.36 %0.04 %

Statistics per Operating System

Operating SystemSameSlowerFasterNoiseUnknown
macOS 13.045.38 %2.30 %39.90 %12.36 %0.07 %
Windows 1160.21 %4.65 %23.37 %11.75 %0.03 %
raspbian 1151.72 %9.15 %35.27 %3.79 %0.07 %
macOS Monterey 12.660.96 %3.45 %20.07 %15.43 %0.09 %
ubuntu 18.0459.23 %13.35 %18.99 %8.38 %0.04 %
Windows 1058.81 %5.86 %20.69 %14.62 %0.03 %

Statistics per Namespace

Details
NamespaceSameSlowerFasterNoiseUnknown
Benchmark12.50 %0.00 %87.50 %0.00 %0.00 %
BenchmarksGame70.48 %9.05 %20.48 %0.00 %0.00 %
Benchstone.BenchF76.50 %8.50 %15.00 %0.00 %0.00 %
Benchstone.BenchI62.08 %10.42 %27.50 %0.00 %0.00 %
Benchstone.MDBenchF38.00 %2.00 %60.00 %0.00 %0.00 %
Benchstone.MDBenchI21.00 %12.00 %67.00 %0.00 %0.00 %
Devirtualization82.00 %2.00 %0.00 %16.00 %0.00 %
Exceptions72.78 %2.78 %24.44 %0.00 %0.00 %
FractalPerf0.00 %90.00 %10.00 %0.00 %0.00 %
GuardedDevirtualization84.76 %0.00 %0.00 %15.24 %0.00 %
IfStatements53.00 %0.00 %47.00 %0.00 %0.00 %
Inlining36.67 %0.00 %10.00 %53.33 %0.00 %
Interop96.67 %0.00 %3.33 %0.00 %0.00 %
JetStream35.00 %5.00 %60.00 %0.00 %0.00 %
Layout90.00 %0.00 %10.00 %0.00 %0.00 %
Lowering90.00 %0.00 %0.00 %10.00 %0.00 %
MicroBenchmarks.Serializers67.02 %2.82 %30.15 %0.00 %0.00 %
Microsoft.AspNetCore.Server.Kestrel.Performance77.50 %7.50 %15.00 %0.00 %0.00 %
Microsoft.Extensions.Caching.Memory.Tests14.55 %0.00 %85.45 %0.00 %0.00 %
Microsoft.Extensions.Configuration0.00 %0.00 %100.00 %0.00 %0.00 %
Microsoft.Extensions.Configuration.Xml77.50 %0.00 %22.50 %0.00 %0.00 %
Microsoft.Extensions.DependencyInjection34.19 %0.97 %62.26 %2.58 %0.00 %
Microsoft.Extensions.Logging69.43 %2.57 %24.57 %3.43 %0.00 %
Microsoft.Extensions.Primitives.Performance47.50 %2.50 %3.75 %46.25 %0.00 %
Microsoft.Extensions.Primitives38.89 %2.78 %21.67 %36.67 %0.00 %
PerfLabTests59.75 %9.63 %22.88 %7.75 %0.00 %
PerfLabTests.CastingPerf254.67 %8.00 %37.33 %0.00 %0.00 %
SciMark256.00 %2.00 %42.00 %0.00 %0.00 %
SIMD88.89 %0.00 %11.11 %0.00 %0.00 %
Span82.80 %1.60 %15.60 %0.00 %0.00 %
StoreBlock54.00 %0.33 %2.67 %43.00 %0.00 %
System.Buffers.Binary.Tests50.00 %3.75 %20.00 %26.25 %0.00 %
System.Buffers.Tests56.90 %6.47 %31.47 %5.17 %0.00 %
System.Buffers.Text.Tests54.41 %4.41 %21.18 %20.00 %0.00 %
System.Collections68.91 %4.71 %24.86 %1.51 %0.00 %
System.Collections.Concurrent74.20 %8.24 %7.45 %10.11 %0.00 %
System.Collections.Tests55.61 %4.49 %26.17 %13.74 %0.00 %
System.ComponentModel.Tests57.27 %0.00 %42.73 %0.00 %0.00 %
System.ConsoleTests88.33 %8.33 %3.33 %0.00 %0.00 %
System.Diagnostics48.50 %7.00 %44.50 %0.00 %0.00 %
System.Diagnostics.Tracing85.00 %2.50 %12.50 %0.00 %0.00 %
System.Formats.Cbor.Tests72.31 %0.77 %26.92 %0.00 %0.00 %
System.Globalization.Tests78.24 %7.63 %12.29 %1.83 %0.00 %
System70.00 %1.67 %25.56 %2.78 %0.00 %
System.IO.Compression85.69 %3.47 %10.83 %0.00 %0.00 %
System.IO.MemoryMappedFiles.Tests32.76 %3.45 %63.79 %0.00 %0.00 %
System.IO.Pipelines.Tests75.00 %2.50 %22.50 %0.00 %0.00 %
System.IO.Pipes.Tests80.00 %13.33 %6.67 %0.00 %0.00 %
System.IO.Tests66.65 %7.08 %23.76 %2.51 %0.00 %
System.Linq.Tests77.52 %7.82 %13.86 %0.79 %0.00 %
System.MathBenchmarks85.94 %3.91 %8.91 %1.25 %0.00 %
System.Memory47.78 %4.23 %21.01 %26.98 %0.00 %
System.Net.Http.Tests45.83 %40.83 %13.33 %0.00 %0.00 %
System.Net.NetworkInformation.Tests60.00 %5.00 %35.00 %0.00 %0.00 %
System.Net.Primitives.Tests63.18 %5.00 %17.27 %14.55 %0.00 %
System.Net.Security.Tests80.14 %4.79 %15.07 %0.00 %0.00 %
System.Net.Sockets.Tests75.51 %6.12 %18.37 %0.00 %0.00 %
System.Net.Tests86.67 %3.33 %10.00 %0.00 %0.00 %
System.Net.WebSockets.Tests65.00 %25.00 %10.00 %0.00 %0.00 %
System.Numerics.Tests39.67 %8.64 %11.08 %40.61 %0.00 %
System.Reflection21.85 %3.57 %71.43 %3.15 %0.00 %
System.Runtime.InteropServices.Tests85.00 %0.00 %15.00 %0.00 %0.00 %
System.Runtime.Serialization.Formatters.Tests70.00 %20.00 %10.00 %0.00 %0.00 %
System.Security.Cryptography.Primitives.Tests.Performance87.50 %7.50 %5.00 %0.00 %0.00 %
System.Security.Cryptography.Tests68.89 %5.56 %25.56 %0.00 %0.00 %
System.Security.Cryptography.X509Certificates.Tests83.33 %10.00 %6.67 %0.00 %0.00 %
System.Tests55.60 %5.46 %27.84 %11.10 %0.00 %
System.Text.Encodings.Web.Tests76.67 %1.67 %21.67 %0.00 %0.00 %
System.Text.Json.Document.Tests63.00 %0.40 %36.60 %0.00 %0.00 %
System.Text.Json.Node.Tests0.00 %100.00 %0.00 %0.00 %0.00 %
System.Text.Json.Reader.Tests57.50 %0.00 %42.50 %0.00 %0.00 %
System.Text.Json.Serialization.Tests72.03 %1.46 %26.51 %0.00 %0.00 %
System.Text.Json.Tests71.71 %2.54 %25.49 %0.26 %0.00 %
System.Text78.67 %14.00 %7.33 %0.00 %0.00 %
System.Text.RegularExpressions.Tests15.25 %3.46 %80.31 %0.00 %0.97 %
System.Text.Tests66.90 %11.67 %18.81 %2.62 %0.00 %
System.Threading.Channels.Tests67.50 %8.33 %24.17 %0.00 %0.00 %
System.Threading.Tasks.Tests43.33 %16.67 %33.33 %6.67 %0.00 %
System.Threading.Tasks75.00 %2.14 %20.71 %2.14 %0.00 %
System.Threading.Tests72.98 %2.34 %15.11 %9.57 %0.00 %
System.Xml.Linq58.95 %2.63 %28.95 %9.47 %0.00 %
System.Xml.Tests0.00 %0.00 %100.00 %0.00 %0.00 %
V8.Crypto90.00 %10.00 %0.00 %0.00 %0.00 %
V8.Richards80.00 %0.00 %20.00 %0.00 %0.00 %
XmlDocumentTests.XmlDocumentTests63.33 %6.67 %13.33 %16.67 %0.00 %
XmlDocumentTests.XmlNodeListTests95.00 %5.00 %0.00 %0.00 %0.00 %
XmlDocumentTests.XmlNodeTests30.00 %0.00 %0.00 %70.00 %0.00 %
System.Drawing.Tests84.17 %0.83 %10.00 %5.00 %0.00 %
HardwareIntrinsics.RayTracer85.71 %14.29 %0.00 %0.00 %0.00 %

Big thanks to everyone involved!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions