dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15k stars 4.67k forks source link

[perf] System.Text.** performance regressions in Mono AOT x64 microbenchmarks from Preview 5 to Preview 7 #89242

Closed kotlarmilos closed 1 month ago

kotlarmilos commented 1 year ago

Description

The following performance regressions occurred between the Preview 4 snapshot (May 2nd, 2023) and Preview 7 snapshot (July 19th, 2023).

The configuration used for the benchmarks is Mono AOT with LLVM on x64 ubuntu 18.04.

Name Baseline Value Compare Value % Difference
System.Threading.Tests.Perf_ThreadStatic.SetThreadStatic 2.17 2.37 9.22
System.Text.Tests.Perf_Encoding.GetChars(size: 16, encName: utf-8) 134.63 172.69 28.27
System.Text.Tests.Perf_Encoding.GetByteCount(size: 512, encName: ascii) 8.81 9.34 6.02
System.Text.Tests.Perf_Encoding.GetByteCount(size: 16, encName: ascii) 8.81 9.36 6.24
System.Text.RegularExpressions.Tests.Perf_Regex_Common.Uri_IsNotMatch(Options: IgnoreCase, Compiled) 367.94 481.19 30.78
System.Text.RegularExpressions.Tests.Perf_Regex_Common.ReplaceWords(Options: Compiled) 12433.17 19087.83 53.52
System.Text.RegularExpressions.Tests.Perf_Regex_Common.OneNodeBacktracking(Options: IgnoreCase, Compiled) 303.51 556.79 83.45
System.Text.RegularExpressions.Tests.Perf_Regex_Common.MatchWord(Options: IgnoreCase, Compiled) 528.17 833.11 57.74
System.Text.RegularExpressions.Tests.Perf_Regex_Common.IP_IsNotMatch(Options: Compiled) 346.94 510 47
System.Text.RegularExpressions.Tests.Perf_Regex_Cache.IsMatch(total: 40000, unique: 1600, cacheSize: 3200) 18834360.75 20212941.8 7.32
System.Text.Json.Tests.Utf8JsonReaderCommentsTests.Utf8JsonReaderCommentParsing(CommentHandling: Allow, SegmentSize: 100, TestCase: LongMultiLine) 41771.44 83590.36 100.11
System.Text.Json.Tests.Perf_Strings.WriteStringsUtf16(Formatted: True, SkipValidation: False, Escaped: AllEscaped) 193792673.31 207213555.8 6.93
System.Text.Json.Tests.Perf_Strings.WriteStringsUtf16(Formatted: False, SkipValidation: False, Escaped: AllEscaped) 192543548.4 213535368.27 10.9
System.Text.Json.Tests.Perf_Get.GetString 27491.32 39333.15 43.07
System.Text.Json.Tests.Perf_Get.GetBoolean 364.4 398.96 9.48
System.Text.Json.Document.Tests.Perf_DocumentParse.Parse(IsDataIndented: True, TestRandomAccess: True, TestCase: BasicJson) 6017.26 6396.89 6.31
System.Text.Json.Document.Tests.Perf_DocumentParse.Parse(IsDataIndented: False, TestRandomAccess: True, TestCase: HelloWorld) 881.58 983.05 11.51
kotlarmilos commented 1 year ago

@eiriktsarpalis @stephentoub We are trying to narrow down changes between May 2nd, 2023 and July 19th, 2023 that may have caused the regressions. If you are aware of any changes that might have potentially caused these regressions, please let us know.

lewing commented 1 year ago

https://github.com/dotnet/runtime/pull/85558

steveisok commented 1 month ago

There does not appear to be a whole lot of action we can take as this is about .NET 8 preview to preview regressions.