.NET 6.0 Microbenchmarks Performance Study Report #59272
Labels
area-Meta
tenet-performance
Performance related issue
tracking
This issue is tracking the completion of other related issues.
Milestone
The goal of this study was simple: ensure that we ship .NET 6 without any performance regressions, especially in the configs not covered by .NET Performance Lab.
We have not changed the methodology since last year, so if you are interested in details about methodology please read #41871.
Data
This year, we have covered more configs than ever! Namely:
Most of the benchmarks were run on bare-metal machines, but some were executed on Azure VMs.
This would not be possible without the help from: @AndyAyersMS @BruceForstall @bwadswor @carlossanlop @danmoseley @jeffhandley @michaelgsharp @sharwell @smitpatel @vatsan-madhavan @wfurt who contributed their results and time.
Everyone interested can download the data from here and here (GitHub does not support files larger than 100 MB so I had to split .NET 5 and 6 results into two separate archives). The full report generated by the tool is available here. The full report contains also improvements, so if you read it from the end you can see the biggest perf improvements.
Moreover, the full historical data which again turned out to be extremely useful is available here.
Regressions
By design
System.Memory.Span<Byte>.IndexOfAnyFourValues(Size: 512)
,System.Memory.Span<Int32>.IndexOfAnyFourValues(Size: 512)
:System.Linq.Tests.Perf_Enumerable.TakeLastHalf(input: List)
System.Collections.Concurrent.AddRemoveFromSameThreads*
System.Tests.Perf_Random.NextDouble
,System.Tests.Perf_Random.Next_int
,System.Tests.Perf_Random.Next_int_int
,System.Tests.Perf_Random.NextBytes_span
System.IO.Tests.BinaryWriterExtendedTests.WriteAsciiCharArray(StringLengthInChars: 32)
System.IO.Tests.Perf_FileStream.ReadAsync(fileSize: 1024, userBufferSize: 1024, options: Asynchronous)
FileStream
being 100% async nowInvestigation in progress
System.Numerics.Tests.Perf_Matrix3x2.IsIdentityBenchmark
System.Numerics.Tests.Perf_Vector3.DistanceBenchmark
,System.Numerics.Tests.Perf_Vector2.DistanceBenchmark
System.Globalization.Tests.StringEquality.Compare_Same_Upper(Count: 1024, Options: (en-US, OrdinalIgnoreCase))
,System.Globalization.Tests.StringEquality.Compare_DifferentFirstChar(Count: 1024, Options: (en-US, Ordinal))
,System.Buffers.Text.Tests.Utf8FormatterTests.FormatterInt64(value: 12345)
,System.Tests.Perf_Int32.ToStringHex(value: 2147483647)
,System.Globalization.Tests.StringEquality.Compare_Same_Upper(Count: 1024, Options: (en-US, Ordinal))
System.Collections.ContainsKeyFalse<Int32, Int32>.SortedList(Size: 512)
System.Collections.ContainsKeyFalse<Int32, Int32>.ConcurrentDictionary(Size: 512)
System.Text.Json.Serialization.Tests.ReadJson<Int32>.DeserializeFromStream
System.Text.Tests.Perf_StringBuilder.ctor_capacity(length: 100000)
,System.Text.Tests.Perf_StringBuilder.ToString_MultipleSegments(length: 100000)
andSystem.Text.Tests.Perf_StringBuilder.ctor_string(length: 100000)
System.Collections.CtorDefaultSize<Int32>.ConcurrentBag
System.Text.Perf_Utf8Encoding.GetBytes(Input: Cyrillic)
System.Collections.Sort<IntClass>.Array(Size: 512)
System.Threading.Tests.Perf_Timer.ShortScheduleAndDisposeWithFiringTimers
PerfLabTests.DelegatePerf.DelegateInvoke
https://github.com/dotnet/runtime/issues/59152
, macOS-specificMicrosoft.Extensions.Logging.ScopesOverheadBenchmark.FilteredByLevel_InsideScope(HasISupportLoggingScopeLogger: False, CaptureScopes: True)
None of the regressions reported above is critical, but in my opinion, we should have a good understanding of #59145 before we ship .NET 6.
Noise, flaky or multimodal
The following benchmarks showed up in the report generated by the tool, but were not actual regressions:
System.Collections.CopyTo<Int32>*
System.Net.Primitives.Tests.IPAddressPerformanceTests.Ctor_Span(address: [16, 32, 48, 64, 80, ...])
System.Buffers.Tests.ReadOnlySequenceTests<Byte>.SliceTenSegments
System.Numerics.Tests.Perf_Matrix4x4.CreateReflectionBenchmark
System.Memory.Span<Int32>.EndsWith(Size: 512)
System.Memory.Span<Int32>.BinarySearch(Size: 512)
([Perf] Regressions in System.Memory.Span<Byte>.BinarySearch #56402)PerfLabTests.CastingPerf.CheckArrayIsVariantGenericInterfaceNo
System.Memory.ReadOnlySpan.IndexOfString(input: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", value: "x", comparisonType: InvariantCultureIgnoreCase)
System.Net.Security.Tests.SslStreamTests.ConcurrentReadWrite
PerfLabTests.DelegatePerf.MulticastDelegateInvoke(length: 1000)
System.Numerics.Tests.Perf_BitOperations.PopCount_uint
,System.Numerics.Tests.Perf_BitOperations.LeadingZeroCount_uint
: memory alignmentBig thanks to everyone involved!
The text was updated successfully, but these errors were encountered: