You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Perf] Linux/x64: Regression in System.Text.Json.Tests.Perf_Basic on 8/19/2024 8:38:43 PM #107044
changed the title [-][Perf] Linux/x64: 1 Regression on 8/19/2024 8:38:43 PM[/-][+][Perf] Linux/x64: Regression in System.Text.Json.Tests.Perf_Basic on 8/19/2024 8:38:43 PM[/+]on Aug 27, 2024
@EgorBot -amd -profiler -commit e96eaee vs previous --envvars DOTNET_JitDisasm:WriteBasicUtf8
// Licensed to the .NET Foundation under one or more agreements.// The .NET Foundation licenses this file to you under the MIT license.// See the LICENSE file in the project root for more information.usingSystem.Buffers;usingSystem.Text.Json.Tests;usingBenchmarkDotNet.Attributes;usingBenchmarkDotNet.Running;namespaceSystem.Text.Json.Tests{publicclassPerf_Basic{privateArrayBufferWriter<byte>_arrayBufferWriter;privateint[]_numberArrayValues;privatebyte[]_extraArrayUtf8;privatebyte[]_firstUtf8;privatebyte[]_lastUtf8;privatebyte[]_ageUtf8;privatebyte[]_phoneNumbersUtf8;privatebyte[]_addressUtf8;privatebyte[]_streetUtf8;privatebyte[]_cityUtf8;privatebyte[]_zipUtf8;[Params(false)]publicboolFormatted;[Params(false)]publicboolSkipValidation;[Params(10)]publicintDataSize;[GlobalSetup]publicvoidSetup(){_arrayBufferWriter=newArrayBufferWriter<byte>();varrandom=newRandom(42);_numberArrayValues=newint[DataSize];for(inti=0;i<DataSize;i++){_numberArrayValues[i]=random.Next(-10000,10000);}_extraArrayUtf8=Encoding.UTF8.GetBytes("ExtraArray");_firstUtf8=Encoding.UTF8.GetBytes("first");_lastUtf8=Encoding.UTF8.GetBytes("last");_ageUtf8=Encoding.UTF8.GetBytes("age");_phoneNumbersUtf8=Encoding.UTF8.GetBytes("phoneNumbers");_addressUtf8=Encoding.UTF8.GetBytes("address");_streetUtf8=Encoding.UTF8.GetBytes("street");_cityUtf8=Encoding.UTF8.GetBytes("city");_zipUtf8=Encoding.UTF8.GetBytes("zip");}[Benchmark][MemoryRandomization]publicvoidWriteBasicUtf8(){_arrayBufferWriter.Clear();using(varjson=newUtf8JsonWriter(_arrayBufferWriter,newJsonWriterOptions{Indented=Formatted,SkipValidation=SkipValidation})){json.WriteStartObject();json.WriteNumber(_ageUtf8,42);json.WriteString(_firstUtf8,"John");json.WriteString(_lastUtf8,"Smith");json.WriteStartArray(_phoneNumbersUtf8);json.WriteStringValue("425-000-1212");json.WriteStringValue("425-000-1213");json.WriteEndArray();json.WriteStartObject(_addressUtf8);json.WriteString(_streetUtf8,"1 Microsoft Way");json.WriteString(_cityUtf8,"Redmond");json.WriteNumber(_zipUtf8,98052);json.WriteEndObject();json.WriteStartArray(_extraArrayUtf8);for(inti=0;i<DataSize;i++){json.WriteNumberValue(_numberArrayValues[i]);}json.WriteEndArray();json.WriteEndObject();json.Flush();}}}}
Activity
[-][Perf] Linux/x64: 1 Regression on 8/19/2024 8:38:43 PM[/-][+][Perf] Linux/x64: Regression in System.Text.Json.Tests.Perf_Basic on 8/19/2024 8:38:43 PM[/+]LoopedBard3 commentedon Aug 27, 2024
Compare range: b1908e2...29f3687
Likely commit: #105098, @MichalPetryka
Related Regressions:
Windows x64: dotnet/perf-autofiling-issues#40240, dotnet/perf-autofiling-issues#40242
Linux Arm64: dotnet/perf-autofiling-issues#40379
dotnet-policy-service commentedon Aug 28, 2024
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
JulieLeeMSFT commentedon Sep 3, 2024
@EgorBo, PTAL.
EgorBo commentedon Sep 4, 2024
@EgorBot -intel -amd -commit e96eaee vs previous --filter System.Text.Json.Tests.Perf_Basic.WriteBasicUtf8
EgorBo commentedon Sep 4, 2024
EgorBo commentedon Sep 4, 2024
@EgorBot -amd -profiler -commit e96eaee vs previous --envvars DOTNET_JitDisasm:WriteBasicUtf8
EgorBo commentedon Sep 4, 2024
seems like a small difference in inlining decision's e.g.
TryFormatI don't see anything we can do for 9.0 here.It also looks like inliner inlined too much in general into
WriteBasicUtf8, more than 250 basic blocks, 8kb of code (for both before/after cases)