Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't set CORINFO_FLG_CUSTOMLAYOUT for auto-layout structs #71673

Merged
merged 2 commits into from
Jul 6, 2022

Conversation

EgorBo
Copy link
Member

@EgorBo EgorBo commented Jul 5, 2022

Close #71667

Apply @SingleAccretion's suggestion in #71667 (comment) to see if it works (works locally, also I tested various kinds of structs to see when "ExplicitSize" is reported and when not) - if it passes the tests I will run jit-diff tools locally to estimate impact.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jul 5, 2022
@ghost ghost assigned EgorBo Jul 5, 2022
@ghost
Copy link

ghost commented Jul 5, 2022

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Issue Details

Apply @SingleAccretion's advise in #71667 (comment) to see if it works (works locally, also I tests various kinds of structs to see when "ExplicitSize" is reported and when not) - if it passes the tests I will run jit-diff tools locally to estimate impact.

Author: EgorBo
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@EgorBo
Copy link
Member Author

EgorBo commented Jul 5, 2022

Fun fact: crossgen is not affected - it checks differently

// The CLR has more complicated rules around CUSTOMLAYOUT, but this will do.
if (metadataType.IsExplicitLayout || (metadataType.IsSequentialLayout && metadataType.GetClassLayout().Size != 0) || metadataType.IsWellKnownType(WellKnownType.TypedReference))
result |= CorInfoFlag.CORINFO_FLG_CUSTOMLAYOUT;

pMT == g_TypedReferenceMT ||
VMClsHnd.IsNativeValueType())
{
// All kinds of structs with Size=.., Pack=... will be marked as "Explicit Size"
// and end up as "custom layout". We consider "Auto-layout" as non-custom one
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We consider "Auto-layout" as non-custom one

Is this an okay assumption?

Copy link
Member Author

@EgorBo EgorBo Jul 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's always stable and Size=... will be no-op and user unlikely will use it in inappropriate ways like storing some custom data in that padding of Span

Copy link
Member Author

@EgorBo EgorBo Jul 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it might be not a correct assumption 🤔 let me check what might happen with auto-layout

Copy link
Member

@jkotas jkotas Jul 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition is very fragile. The meaning of CORINFO_FLG_CUSTOMLAYOUT is very poorly defined. I do not think you want to be touching it to get the regression fixed quickly.

It sounds like that some flags on Span<T> MethodTable changed and that introduced the regression. What are the flags on MethodTable that changed?

Copy link
Member Author

@EgorBo EgorBo Jul 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jkotas in JIT we have a logic:

    if (StructHasCustomLayout(typeFlags) && ((typeFlags & CORINFO_FLG_CONTAINS_GC_PTR) == 0))
    {
        structPromotionInfo.customLayout = true;
    }

our assumption that with the previous impl it was not reported as CORINFO_FLG_CONTAINS_GC_PTR with e.g. ByReference<byte>

Copy link
Member Author

@EgorBo EgorBo Jul 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jkotas @AaronRobinsonMSFT

So for Span<byte>:

pMT->ContainsPointers();  // was: 0, now: 0
pClass->IsManagedSequential(); // was: 1, now: 0
pClass->HasExplicitSize(); // was: 0, now: 0
pClass->IsAutoLayoutOrHasAutoLayoutField(); // was: 0, now: 0
pMT->dwFlags // was: 266256, now: 266256

Seems like the only thing changed is IsManagedSequential to 0 that with current logic leads to CORINFO_FLG_CUSTOMLAYOUT being sent to JIT.
From my understanding, the primary usage for this flag is to tell jit that e.g. holes in current struct are likely "valueable" so it better not promote it.

As I noted earlier, the check is different in crossgen (looks better for jit):

// The CLR has more complicated rules around CUSTOMLAYOUT, but this will do.
if (metadataType.IsExplicitLayout || (metadataType.IsSequentialLayout && metadataType.GetClassLayout().Size != 0) || metadataType.IsWellKnownType(WellKnownType.TypedReference))
result |= CorInfoFlag.CORINFO_FLG_CUSTOMLAYOUT;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the only thing changed is IsManagedSequential to 0 that with current logic leads to

So the simple fix should be to change this back. I think that the following change in TypeHasGCPointers is going to do that:

< if (CorTypeInfo::IsPrimitiveType(corElemType) || corElemType == ELEMENT_TYPE_PTR || corElemType == ELEMENT_TYPE_FNPTR)
> if (CorTypeInfo::IsPrimitiveType(corElemType) || corElemType == ELEMENT_TYPE_PTR || corElemType == ELEMENT_TYPE_FNPTR || corElemType == ELEMENT_TYPE_BYREF)

The custom layout flag is a mess and it would be nice to revisit it, but it should be done in a separate PR.

Copy link
Member

@jakobbotsch jakobbotsch Jul 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We no longer classify System.Span`1 as managed sequential because TypeHasGCPointers(ELEMENT_TYPE_BYREF, ...) returns true, so we set fDisqualifyFromManagedSequential in DetermineBlittabilityAndManagedSequential. Before the change TypeHasGCPointers(ELEMENT_TYPE_VALUETYPE, <type handle for System.ByReference`1>) was returning false.

EDIT: Ah, looks like Jan beat me to it :-)

Copy link
Member

@jkotas jkotas Jul 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice that the logic in

if (CorTypeInfo::IsPrimitiveType(corElemType) || corElemType == ELEMENT_TYPE_PTR || corElemType == ELEMENT_TYPE_FNPTR)
{
return FALSE;
}
if (corElemType == ELEMENT_TYPE_VALUETYPE)
{
_ASSERTE(!pNestedType.IsNull());
return pNestedType.GetMethodTable()->ContainsPointers() != FALSE;
}
is inconsistent right now. It only returns true for GC pointers (that do not include byrefs) for nested layout, but it returns true for both GC pointers and byrefs when they are contained directly.

The change that I have proposed above is going to fix this inconsistency.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The custom layout flag is a mess and it would be nice to revisit it, but it should be done in a separate PR.

I have opened #71711 to track this.

@EgorBo
Copy link
Member Author

EgorBo commented Jul 6, 2022

/azp run runtime-coreclr outerloop, runtime-libraries-coreclr outerloop, runtime-coreclr gcstress0x3-gcstress0xc, runtime-coreclr jitstressregs

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming that it passes the CI and fixes the codegen regression

@EgorBo
Copy link
Member Author

EgorBo commented Jul 6, 2022

fixes the codegen regression

Thanks for the feedback, it does fix the regression!

@tannergooding
Copy link
Member

Thanks for the feedback, it does fix the regression!

Could we get jit-diff --diff --pmi at least for frameworks and benchmarks for before #71498 and after this PR so we can get a sense of roughly how much is fixed vs not? Ideally its roughly 1-to-1 but I imagine there may be other diffs lingering still and having the actual PMI diffs might be helpful in tracking that.

@EgorBo EgorBo marked this pull request as ready for review July 6, 2022 08:29
@EgorBo
Copy link
Member Author

EgorBo commented Jul 6, 2022

The diffs look massive for this change (Main vs this PR):

Found 442 files with textual diffs.

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 66702677
Total bytes of diff: 58727488
Total bytes of delta: -7975189 (-11.96 % of base)
Total relative delta: -2512.16
    diff is an improvement.
    relative diff is an improvement.


Total byte diff includes -6089044 bytes from reconciling methods
        Base had 25021 unique methods,  6142320 unique bytes
        Diff had  106 unique methods,    53276 unique bytes

Top file improvements (bytes):
    -2058685 : Microsoft.CodeAnalysis.dasm (-100.00% of base)
    -1784012 : System.Data.Common.dasm (-100.00% of base)
     -988531 : Newtonsoft.Json.dasm (-100.00% of base)
     -971212 : System.Security.Cryptography.dasm (-100.00% of base)
     -539622 : System.Private.CoreLib.dasm (-8.35% of base)
     -222808 : System.Text.Json.dasm (-15.90% of base)
     -160609 : System.Runtime.Numerics.dasm (-100.00% of base)
     -130501 : System.Private.Xml.dasm (-3.03% of base)
      -94868 : System.Formats.Tar.dasm (-63.49% of base)
      -87955 : System.Net.Http.dasm (-9.53% of base)
      -78339 : System.Numerics.Tensors.dasm (-20.32% of base)
      -73609 : System.Security.Cryptography.Pkcs.dasm (-13.93% of base)
      -64398 : System.Memory.dasm (-18.11% of base)
      -58087 : System.Threading.Tasks.Dataflow.dasm (-4.57% of base)
      -30767 : System.Text.RegularExpressions.dasm (-4.62% of base)
      -24516 : System.Formats.Asn1.dasm (-24.82% of base)
      -23593 : Microsoft.Diagnostics.Tracing.TraceEvent.dasm (-0.59% of base)
      -22009 : System.Net.Security.dasm (-11.44% of base)
      -19530 : System.Diagnostics.DiagnosticSource.dasm (-8.74% of base)
      -19020 : Microsoft.Extensions.Logging.Console.dasm (-20.66% of base)
      -18600 : System.Private.Uri.dasm (-17.41% of base)
      -18039 : System.Formats.Cbor.dasm (-27.54% of base)
      -17454 : System.Private.DataContractSerialization.dasm (-1.94% of base)
      -15672 : Microsoft.Extensions.DependencyModel.dasm (-16.37% of base)
      -14856 : System.Net.Sockets.dasm (-6.34% of base)
      -13665 : System.Net.Mail.dasm (-5.65% of base)
      -13609 : Microsoft.CodeAnalysis.VisualBasic.dasm (-0.19% of base)
      -13585 : System.Net.HttpListener.dasm (-4.94% of base)
      -13442 : System.Net.Primitives.dasm (-15.83% of base)
      -13008 : System.Data.OleDb.dasm (-3.66% of base)

169 total files with Code Size differences (169 improved, 0 regressed), 104 unchanged.

Top method regressions (bytes):
        8653 (     ∞ of base) : System.Text.Json.dasm - JsonPropertyInfo`1:Initialize(Type,Type,ubyte,MemberInfo,bool,JsonConverter,Nullable`1,JsonSerializerOptions,JsonTypeInfo,bool):this (0 base, 8 diff methods)
        5544 (     ∞ of base) : System.Text.Json.dasm - ReflectionJsonTypeInfo`1:AddProperty(MemberInfo,Type,Type,bool,JsonSerializerOptions):JsonPropertyInfo:this (0 base, 8 diff methods)
        4920 (     ∞ of base) : System.Text.Json.dasm - JsonPropertyInfo`1:InitializeForSourceGen(JsonSerializerOptions,JsonPropertyInfoValues`1):this (0 base, 8 diff methods)
        2795 (     ∞ of base) : System.Net.Http.dasm - <SendAsync>d__106:MoveNext():this (0 base, 1 diff methods)
        2707 (     ∞ of base) : System.Net.Http.dasm - <ProcessOutgoingFramesAsync>d__78:MoveNext():this (0 base, 1 diff methods)
        2702 (     ∞ of base) : System.Net.Http.dasm - <>c:<SendHeadersAsync>b__93_0(ValueTuple`5,Memory`1):bool:this (0 base, 1 diff methods)
        2544 (     ∞ of base) : System.Text.Json.dasm - ReflectionJsonTypeInfo`1:CacheMember(Type,Type,MemberInfo,bool,Nullable`1,byref,byref):this (0 base, 8 diff methods)
        2011 (     ∞ of base) : System.Net.Http.dasm - <SendStreamDataAsync>d__94:MoveNext():this (0 base, 1 diff methods)
        1957 (     ∞ of base) : System.Net.Http.dasm - <SendHeadersAsync>d__93:MoveNext():this (0 base, 1 diff methods)
        1936 (2,805.80% of base) : System.Formats.Tar.dasm - TarWriter:ReadFileFromDiskAndWriteToArchiveStreamAsEntry(String,String):this
        1209 (40.34% of base) : System.Text.Json.dasm - SourceGenJsonTypeInfo`1:AddPropertiesUsingSourceGenInfo():this (8 methods)
        1183 (     ∞ of base) : System.Net.Http.dasm - <>c:<SendStreamDataAsync>b__94_0(ValueTuple`4,Memory`1):bool:this (0 base, 1 diff methods)
        1020 (163.20% of base) : System.Net.Http.dasm - Http2Connection:ProcessGoAwayFrame(FrameHeader):this
        1003 (210.27% of base) : System.Text.Json.dasm - ReflectionJsonTypeInfo`1:GetNumberHandlingForType(Type):Nullable`1 (8 methods)
         841 (     ∞ of base) : System.Text.Json.dasm - CustomJsonTypeInfo`1:GetConverter(JsonSerializerOptions):JsonConverter (0 base, 8 diff methods)
         825 (     ∞ of base) : System.Net.Http.dasm - <>c:<SendRstStreamAsync>b__81_0(ValueTuple`3,Memory`1):bool:this (0 base, 1 diff methods)
         825 (     ∞ of base) : System.Net.Http.dasm - <>c:<SendWindowUpdateAsync>b__96_0(ValueTuple`3,Memory`1):bool:this (0 base, 1 diff methods)
         816 (     ∞ of base) : System.Text.Json.dasm - JsonPropertyInfo`1:Configure():this (0 base, 8 diff methods)
         755 (     ∞ of base) : System.Net.Http.dasm - <>c:<SendPingAsync>b__80_0(ValueTuple`3,Memory`1):bool:this (0 base, 1 diff methods)
         727 (71.27% of base) : System.Text.Json.dasm - JsonTypeInfo:CreateJsonTypeInfo(JsonSerializerOptions):JsonTypeInfo`1 (8 methods)
         692 (     ∞ of base) : System.Security.Cryptography.Pkcs.dasm - PkcsHelpers:CreateBestPkcs9AttributeObjectAvailable(Oid,ref):Pkcs9AttributeObject (0 base, 1 diff methods)
         642 (     ∞ of base) : System.Text.Json.dasm - <>c__DisplayClass12_0:<SetSetter>b__0(Object,Object):this (0 base, 8 diff methods)
         624 (     ∞ of base) : System.Text.Json.dasm - JsonPropertyInfo`1:ShouldSerializeIgnoreConditionWhenWritingDefaultPropertyTypeNotEqualsTypeToConvert(Object,Object):bool:this (0 base, 8 diff methods)
         593 (     ∞ of base) : System.Text.Json.dasm - ThrowHelper:ThrowInvalidOperationException_SerializationDuplicateAttribute(Type,Type,MemberInfo) (0 base, 1 diff methods)
         576 (     ∞ of base) : System.Text.Json.dasm - CastingConverter`2:Cast(double):Nullable`1 (0 base, 8 diff methods)
         576 (     ∞ of base) : System.Text.Json.dasm - CastingConverter`2:Cast(Vector`1):Nullable`1 (0 base, 8 diff methods)
         560 (158.64% of base) : System.Formats.Tar.dasm - TarHeader:WriteAsGnuInternal(Stream,Span`1):this
         557 ( 3.87% of base) : System.Text.RegularExpressions.dasm - SymbolicRegexMatcher`1:FindSubcaptures(ReadOnlySpan`1,int,int,PerThreadData):Registers:this (5 methods)
         550 (98.04% of base) : System.Text.Json.dasm - CustomJsonTypeInfo`1:.ctor(JsonSerializerOptions):this (8 methods)
         517 (     ∞ of base) : System.Text.Json.dasm - JsonPropertyInfo`1:set_EffectiveConverter(JsonConverter):this (0 base, 8 diff methods)

Top method improvements (bytes):
      -60591 (-100.00% of base) : System.Data.Common.dasm - SortExpressionBuilder`1:CloneCast():SortExpressionBuilder`1:this (64 base, 0 diff methods)
      -55864 (-100.00% of base) : Microsoft.CodeAnalysis.dasm - ArrayBuilder`1:ToDictionary(Func`2,IEqualityComparer`1):Dictionary`2:this (64 base, 0 diff methods)
      -54511 (-100.00% of base) : System.Data.Common.dasm - RBTree`1:RBInsert(int,int,int,int,bool):int:this (8 base, 0 diff methods)
      -50238 (-100.00% of base) : Microsoft.CodeAnalysis.dasm - AsyncQueue`1:WithCancellation(Task`1,CancellationToken):Task`1 (64 base, 0 diff methods)
      -40189 (-100.00% of base) : System.Data.Common.dasm - RBTree`1:RBDeleteX(int,int,int):int:this (8 base, 0 diff methods)
      -34868 (-100.00% of base) : System.Data.Common.dasm - RBTree`1:RBDeleteFixup(int,int,int,int):int:this (8 base, 0 diff methods)
      -32736 (-100.00% of base) : Microsoft.CodeAnalysis.dasm - DesktopAssemblyIdentityComparer:.cctor() (1 base, 0 diff methods)
      -29002 (-100.00% of base) : Microsoft.CodeAnalysis.dasm - ArrayBuilder`1:SelectDistinct(Func`2):ImmutableArray`1:this (64 base, 0 diff methods)
      -24826 (-100.00% of base) : Microsoft.CodeAnalysis.dasm - AttributeDescription:.cctor() (1 base, 0 diff methods)
      -22154 (-100.00% of base) : System.Data.Common.dasm - EnumerableRowCollection`1:AddSortExpression(Func`2,IComparer`1,bool,bool):this (64 base, 0 diff methods)
      -17736 (-100.00% of base) : System.Data.Common.dasm - BinaryNode:EvalBinaryOp(int,ExpressionNode,ExpressionNode,DataRow,int,ref):Object:this (1 base, 0 diff methods)
      -14882 (-44.53% of base) : System.Text.Json.dasm - JsonValue`1:TryConvertJsonElement(byref):bool:this (64 methods)
      -13276 (-100.00% of base) : System.Data.Common.dasm - XmlTreeGen:HandleTable(DataTable,XmlDocument,XmlElement,bool):XmlElement:this (1 base, 0 diff methods)
      -12762 (-100.00% of base) : Microsoft.CodeAnalysis.dasm - AnalyzerDriver`1:ExecuteDeclaringReferenceActions(SyntaxReference,SymbolDeclaredCompilationEvent,AnalysisScope,AnalysisState,bool,bool,CancellationToken):this (6 base, 0 diff methods)
      -12523 (-100.00% of base) : System.Security.Cryptography.dasm - KeyFormatHelper:ReadEncryptedPkcs8(ref,ReadOnlyMemory`1,ReadOnlySpan`1,ReadOnlySpan`1,KeyReader`1,byref,byref) (8 base, 0 diff methods)
      -11879 (-30.96% of base) : Microsoft.Extensions.Logging.Console.dasm - JsonConsoleFormatter:Write(byref,IExternalScopeProvider,TextWriter):this (8 methods)
      -11313 (-100.00% of base) : Microsoft.CodeAnalysis.dasm - UnionCollection`1:Create(ImmutableArray`1,Func`2):ICollection`1 (64 base, 0 diff methods)
      -11264 (-100.00% of base) : System.Security.Cryptography.dasm - PemKeyHelpers:ImportEncryptedPem(ReadOnlySpan`1,ReadOnlySpan`1,ImportEncryptedKeyAction`1) (8 base, 0 diff methods)
      -10543 (-100.00% of base) : Microsoft.CodeAnalysis.dasm - ImmutableArrayExtensions:WhereAsArray(ImmutableArray`1,Func`2):ImmutableArray`1 (8 base, 0 diff methods)
      -10176 (-39.56% of base) : System.Numerics.Tensors.dasm - CompressedSparseTensor`1:EnsureCapacity(int,int):this (8 methods)
       -9996 (-100.00% of base) : Microsoft.CodeAnalysis.dasm - AnalyzerExecutor:ExecuteCodeBlockActionsCore(IEnumerable`1,IEnumerable`1,IEnumerable`1,DiagnosticAnalyzer,SyntaxNode,ISymbol,ImmutableArray`1,SemanticModel,Func`2,CodeBlockAnalyzerStateData):this (6 base, 0 diff methods)
       -9422 (-100.00% of base) : System.Data.Common.dasm - SqlConvert:ChangeTypeForXML(Object,Type):Object (1 base, 0 diff methods)
       -9263 (-100.00% of base) : Newtonsoft.Json.dasm - DynamicProxyMetaObject`1:BuildCallMethodWithResult(String,DynamicMetaObjectBinder,IEnumerable`1,DynamicMetaObject,Fallback):DynamicMetaObject:this (8 base, 0 diff methods)
       -9072 (-100.00% of base) : Newtonsoft.Json.dasm - JToken:op_Explicit(JToken):Nullable`1 (17 base, 0 diff methods)
       -9024 (-100.00% of base) : System.Data.Common.dasm - DataTable:DeserializeTableSchema(SerializationInfo,StreamingContext,bool):this (1 base, 0 diff methods)
       -8905 (-100.00% of base) : System.Data.Common.dasm - RBTree`1:LeftRotate(int,int,int):int:this (8 base, 0 diff methods)
       -8905 (-100.00% of base) : System.Data.Common.dasm - RBTree`1:RightRotate(int,int,int):int:this (8 base, 0 diff methods)
       -8894 (-100.00% of base) : System.Data.Common.dasm - XmlTreeGen:SchemaTree(XmlDocument,XmlWriter,DataSet,DataTable,bool):this (1 base, 0 diff methods)
       -8870 (-100.00% of base) : Microsoft.CodeAnalysis.dasm - ArrayBuilderExtensions:SelectAsArray(ArrayBuilder`1,Func`2):ImmutableArray`1 (8 base, 0 diff methods)
       -8688 (-100.00% of base) : Newtonsoft.Json.dasm - JsonTextWriter:WriteValueAsync(Nullable`1,CancellationToken):Task:this (17 base, 0 diff methods)

Top method regressions (percentages):
           7 (     ∞ of base) : System.Text.Json.dasm - <>c:<FinishEditingAndMakeReadOnly>b__11_0(JsonPropertyInfo):int:this (0 base, 1 diff methods)
           6 (     ∞ of base) : System.Net.Http.dasm - <>c:<FlushAsync>b__74_0(int,Memory`1):bool:this (0 base, 1 diff methods)
         336 (     ∞ of base) : System.Text.Json.dasm - <>c:<MapInterfaceTypesToCallbacks>b__10_0(Object):this (0 base, 8 diff methods)
         336 (     ∞ of base) : System.Text.Json.dasm - <>c:<MapInterfaceTypesToCallbacks>b__10_1(Object):this (0 base, 8 diff methods)
         336 (     ∞ of base) : System.Text.Json.dasm - <>c:<MapInterfaceTypesToCallbacks>b__10_2(Object):this (0 base, 8 diff methods)
         336 (     ∞ of base) : System.Text.Json.dasm - <>c:<MapInterfaceTypesToCallbacks>b__10_3(Object):this (0 base, 8 diff methods)
         340 (     ∞ of base) : System.Net.Http.dasm - <>c:<SendEndStreamAsync>b__95_0(ValueTuple`2,Memory`1):bool:this (0 base, 1 diff methods)
        2702 (     ∞ of base) : System.Net.Http.dasm - <>c:<SendHeadersAsync>b__93_0(ValueTuple`5,Memory`1):bool:this (0 base, 1 diff methods)
         755 (     ∞ of base) : System.Net.Http.dasm - <>c:<SendPingAsync>b__80_0(ValueTuple`3,Memory`1):bool:this (0 base, 1 diff methods)
         825 (     ∞ of base) : System.Net.Http.dasm - <>c:<SendRstStreamAsync>b__81_0(ValueTuple`3,Memory`1):bool:this (0 base, 1 diff methods)
         324 (     ∞ of base) : System.Net.Http.dasm - <>c:<SendSettingsAckAsync>b__79_0(Http2Connection,Memory`1):bool:this (0 base, 1 diff methods)
        1183 (     ∞ of base) : System.Net.Http.dasm - <>c:<SendStreamDataAsync>b__94_0(ValueTuple`4,Memory`1):bool:this (0 base, 1 diff methods)
         825 (     ∞ of base) : System.Net.Http.dasm - <>c:<SendWindowUpdateAsync>b__96_0(ValueTuple`3,Memory`1):bool:this (0 base, 1 diff methods)
          35 (     ∞ of base) : System.Text.RegularExpressions.dasm - <>c:<set_MaxCacheSize>b__11_0(Node,Node):int:this (0 base, 1 diff methods)
           8 (     ∞ of base) : System.Text.Json.dasm - <>c__DisplayClass11_0:.ctor():this (0 base, 8 diff methods)
         429 (     ∞ of base) : System.Text.Json.dasm - <>c__DisplayClass11_0:<SetGetter>b__0(Object):Object:this (0 base, 8 diff methods)
           8 (     ∞ of base) : System.Text.Json.dasm - <>c__DisplayClass11_1:.ctor():this (0 base, 8 diff methods)
          58 (     ∞ of base) : System.Text.Json.dasm - <>c__DisplayClass11_1:<SetGetter>b__1(Object):__Canon:this (0 base, 1 diff methods)
          67 (     ∞ of base) : System.Text.Json.dasm - <>c__DisplayClass11_1:<SetGetter>b__1(Object):double:this (0 base, 1 diff methods)
          62 (     ∞ of base) : System.Text.Json.dasm - <>c__DisplayClass11_1:<SetGetter>b__1(Object):int:this (0 base, 1 diff methods)
          63 (     ∞ of base) : System.Text.Json.dasm - <>c__DisplayClass11_1:<SetGetter>b__1(Object):long:this (0 base, 1 diff methods)
          48 (     ∞ of base) : System.Text.Json.dasm - <>c__DisplayClass11_1:<SetGetter>b__1(Object):Nullable`1:this (0 base, 1 diff methods)
          64 (     ∞ of base) : System.Text.Json.dasm - <>c__DisplayClass11_1:<SetGetter>b__1(Object):short:this (0 base, 1 diff methods)
          63 (     ∞ of base) : System.Text.Json.dasm - <>c__DisplayClass11_1:<SetGetter>b__1(Object):ubyte:this (0 base, 1 diff methods)
          85 (     ∞ of base) : System.Text.Json.dasm - <>c__DisplayClass11_1:<SetGetter>b__1(Object):Vector`1:this (0 base, 1 diff methods)
           8 (     ∞ of base) : System.Text.Json.dasm - <>c__DisplayClass12_0:.ctor():this (0 base, 8 diff methods)
         642 (     ∞ of base) : System.Text.Json.dasm - <>c__DisplayClass12_0:<SetSetter>b__0(Object,Object):this (0 base, 8 diff methods)
           8 (     ∞ of base) : System.Text.Json.dasm - <>c__DisplayClass12_1:.ctor():this (0 base, 8 diff methods)
          12 (     ∞ of base) : System.Text.Json.dasm - <>c__DisplayClass12_1:<SetSetter>b__1(Object,__Canon):this (0 base, 1 diff methods)
          71 (     ∞ of base) : System.Text.Json.dasm - <>c__DisplayClass12_1:<SetSetter>b__1(Object,double):this (0 base, 1 diff methods)

Top method improvements (percentages):
        -418 (-100.00% of base) : Microsoft.CodeAnalysis.dasm - _AppDomain:.cctor() (1 base, 0 diff methods)
        -644 (-100.00% of base) : Microsoft.CodeAnalysis.dasm - _Assembly:.cctor() (1 base, 0 diff methods)
        -148 (-100.00% of base) : Microsoft.CodeAnalysis.dasm - _CultureInfo:.cctor() (1 base, 0 diff methods)
        -177 (-100.00% of base) : Microsoft.CodeAnalysis.dasm - _Module:.cctor() (1 base, 0 diff methods)
        -214 (-100.00% of base) : Microsoft.CodeAnalysis.dasm - _ResolveEventArgs:.cctor() (1 base, 0 diff methods)
        -250 (-100.00% of base) : Microsoft.CodeAnalysis.dasm - _RuntimeEnvironment:.cctor() (1 base, 0 diff methods)
       -1082 (-100.00% of base) : Microsoft.CodeAnalysis.dasm - <<ComputeAnalyzerDiagnosticsAsync>b__1>d:MoveNext():this (1 base, 0 diff methods)
         -28 (-100.00% of base) : Microsoft.CodeAnalysis.dasm - <<ComputeAnalyzerDiagnosticsAsync>b__1>d:SetStateMachine(IAsyncStateMachine):this (1 base, 0 diff methods)
       -1248 (-100.00% of base) : Microsoft.CodeAnalysis.dasm - <<GetAnalyzerActionsAsync>b__0>d:MoveNext():this (1 base, 0 diff methods)
         -47 (-100.00% of base) : Microsoft.CodeAnalysis.dasm - <<GetAnalyzerActionsAsync>b__0>d:SetStateMachine(IAsyncStateMachine):this (1 base, 0 diff methods)
        -867 (-100.00% of base) : Newtonsoft.Json.dasm - <<InternalWriteEndAsync>g__AwaitEnd|11_2>d:MoveNext():this (1 base, 0 diff methods)
         -28 (-100.00% of base) : Newtonsoft.Json.dasm - <<InternalWriteEndAsync>g__AwaitEnd|11_2>d:SetStateMachine(IAsyncStateMachine):this (1 base, 0 diff methods)
       -1111 (-100.00% of base) : Newtonsoft.Json.dasm - <<InternalWriteEndAsync>g__AwaitIndent|11_1>d:MoveNext():this (1 base, 0 diff methods)
         -28 (-100.00% of base) : Newtonsoft.Json.dasm - <<InternalWriteEndAsync>g__AwaitIndent|11_1>d:SetStateMachine(IAsyncStateMachine):this (1 base, 0 diff methods)
       -1346 (-100.00% of base) : Newtonsoft.Json.dasm - <<InternalWriteEndAsync>g__AwaitProperty|11_0>d:MoveNext():this (1 base, 0 diff methods)
         -28 (-100.00% of base) : Newtonsoft.Json.dasm - <<InternalWriteEndAsync>g__AwaitProperty|11_0>d:SetStateMachine(IAsyncStateMachine):this (1 base, 0 diff methods)
       -1375 (-100.00% of base) : Newtonsoft.Json.dasm - <<InternalWriteEndAsync>g__AwaitRemaining|11_3>d:MoveNext():this (1 base, 0 diff methods)
         -28 (-100.00% of base) : Newtonsoft.Json.dasm - <<InternalWriteEndAsync>g__AwaitRemaining|11_3>d:SetStateMachine(IAsyncStateMachine):this (1 base, 0 diff methods)
       -1235 (-100.00% of base) : Newtonsoft.Json.dasm - <<WriteToAsync>g__AwaitProperties|0_0>d:MoveNext():this (1 base, 0 diff methods)
         -28 (-100.00% of base) : Newtonsoft.Json.dasm - <<WriteToAsync>g__AwaitProperties|0_0>d:SetStateMachine(IAsyncStateMachine):this (1 base, 0 diff methods)
       -2209 (-100.00% of base) : Newtonsoft.Json.dasm - <>c:.cctor() (31 base, 0 diff methods)
        -852 (-100.00% of base) : System.Security.Cryptography.dasm - <>c:.cctor() (12 base, 0 diff methods)
       -7116 (-100.00% of base) : Microsoft.CodeAnalysis.dasm - <>c:.cctor() (100 base, 0 diff methods)
         -71 (-100.00% of base) : System.Runtime.Numerics.dasm - <>c:.cctor() (1 base, 0 diff methods)
        -284 (-100.00% of base) : System.Data.Common.dasm - <>c:.cctor() (4 base, 0 diff methods)
         -31 (-100.00% of base) : Newtonsoft.Json.dasm - <>c:.ctor():this (31 base, 0 diff methods)
         -12 (-100.00% of base) : System.Security.Cryptography.dasm - <>c:.ctor():this (12 base, 0 diff methods)
        -100 (-100.00% of base) : Microsoft.CodeAnalysis.dasm - <>c:.ctor():this (100 base, 0 diff methods)
          -1 (-100.00% of base) : System.Runtime.Numerics.dasm - <>c:.ctor():this (1 base, 0 diff methods)
          -4 (-100.00% of base) : System.Data.Common.dasm - <>c:.ctor():this (4 base, 0 diff methods)

34220 total methods with Code Size differences (33956 improved, 264 regressed), 220369 unchanged.

Checked a few random regressions and they look inlining-related

@EgorBo
Copy link
Member Author

EgorBo commented Jul 6, 2022

Failure is #71684

@EgorBo EgorBo merged commit a965218 into dotnet:main Jul 6, 2022
@EgorBo
Copy link
Member Author

EgorBo commented Jul 6, 2022

jit-diff for before and after #71498

Found 448 files with textual diffs.

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 58794346
Total bytes of diff: 66625663
Total bytes of delta: 7831317 (13.32 % of base)
Total relative delta: 5132.58
    diff is a regression.
    relative diff is a regression.


Total byte diff includes 5917459 bytes from reconciling methods
        Base had  301 unique methods,   136980 unique bytes
        Diff had 24831 unique methods,  6054439 unique bytes

Top file regressions (bytes):
     2058684 : Microsoft.CodeAnalysis.dasm (∞ of base)
     1784012 : System.Data.Common.dasm (∞ of base)
      988531 : Newtonsoft.Json.dasm (∞ of base)
      971096 : System.Security.Cryptography.dasm (∞ of base)
      539732 : System.Private.CoreLib.dasm (9.11% of base)
      230000 : System.Text.Json.dasm (19.59% of base)
      160609 : System.Runtime.Numerics.dasm (∞ of base)
      132531 : System.Private.Xml.dasm (3.17% of base)
       87477 : System.Net.Http.dasm (10.48% of base)
       78339 : System.Numerics.Tensors.dasm (25.50% of base)
       69443 : System.Security.Cryptography.Pkcs.dasm (15.22% of base)
       64386 : System.Memory.dasm (22.11% of base)
       58047 : System.Threading.Tasks.Dataflow.dasm (4.78% of base)
       30924 : System.Text.RegularExpressions.dasm (4.86% of base)
       24732 : System.Formats.Asn1.dasm (33.40% of base)
       24038 : Microsoft.Diagnostics.Tracing.TraceEvent.dasm (0.60% of base)
       22013 : System.Net.Security.dasm (12.92% of base)
       19530 : System.Diagnostics.DiagnosticSource.dasm (9.57% of base)
       19292 : Microsoft.Extensions.Logging.Console.dasm (26.51% of base)
       18610 : System.Private.Uri.dasm (21.09% of base)
       18030 : System.Formats.Cbor.dasm (37.98% of base)
       17457 : System.Private.DataContractSerialization.dasm (1.98% of base)
       16153 : Microsoft.Extensions.DependencyModel.dasm (20.29% of base)
       14824 : System.Net.Sockets.dasm (6.75% of base)
       13672 : System.Net.Mail.dasm (5.99% of base)
       13599 : Microsoft.CodeAnalysis.VisualBasic.dasm (0.19% of base)
       13582 : System.Net.HttpListener.dasm (5.20% of base)
       13438 : System.Net.Primitives.dasm (18.81% of base)
       13008 : System.Data.OleDb.dasm (3.80% of base)
       12803 : System.Drawing.Common.dasm (2.36% of base)

Top file improvements (bytes):
      -55769 : System.Formats.Tar.dasm (-43.65% of base)

169 total files with Code Size differences (1 improved, 168 regressed), 104 unchanged.

Top method regressions (bytes):
       60591 (     ∞ of base) : System.Data.Common.dasm - SortExpressionBuilder`1:CloneCast():SortExpressionBuilder`1:this (0 base, 64 diff methods)
       55864 (     ∞ of base) : Microsoft.CodeAnalysis.dasm - ArrayBuilder`1:ToDictionary(Func`2,IEqualityComparer`1):Dictionary`2:this (0 base, 64 diff methods)
       54511 (     ∞ of base) : System.Data.Common.dasm - RBTree`1:RBInsert(int,int,int,int,bool):int:this (0 base, 8 diff methods)
       50238 (     ∞ of base) : Microsoft.CodeAnalysis.dasm - AsyncQueue`1:WithCancellation(Task`1,CancellationToken):Task`1 (0 base, 64 diff methods)
       40189 (     ∞ of base) : System.Data.Common.dasm - RBTree`1:RBDeleteX(int,int,int):int:this (0 base, 8 diff methods)
       34868 (     ∞ of base) : System.Data.Common.dasm - RBTree`1:RBDeleteFixup(int,int,int,int):int:this (0 base, 8 diff methods)
       32736 (     ∞ of base) : Microsoft.CodeAnalysis.dasm - DesktopAssemblyIdentityComparer:.cctor() (0 base, 1 diff methods)
       29002 (     ∞ of base) : Microsoft.CodeAnalysis.dasm - ArrayBuilder`1:SelectDistinct(Func`2):ImmutableArray`1:this (0 base, 64 diff methods)
       24826 (     ∞ of base) : Microsoft.CodeAnalysis.dasm - AttributeDescription:.cctor() (0 base, 1 diff methods)
       22154 (     ∞ of base) : System.Data.Common.dasm - EnumerableRowCollection`1:AddSortExpression(Func`2,IComparer`1,bool,bool):this (0 base, 64 diff methods)
       17736 (     ∞ of base) : System.Data.Common.dasm - BinaryNode:EvalBinaryOp(int,ExpressionNode,ExpressionNode,DataRow,int,ref):Object:this (0 base, 1 diff methods)
       14882 (80.29% of base) : System.Text.Json.dasm - JsonValue`1:TryConvertJsonElement(byref):bool:this (64 methods)
       13276 (     ∞ of base) : System.Data.Common.dasm - XmlTreeGen:HandleTable(DataTable,XmlDocument,XmlElement,bool):XmlElement:this (0 base, 1 diff methods)
       12762 (     ∞ of base) : Microsoft.CodeAnalysis.dasm - AnalyzerDriver`1:ExecuteDeclaringReferenceActions(SyntaxReference,SymbolDeclaredCompilationEvent,AnalysisScope,AnalysisState,bool,bool,CancellationToken):this (0 base, 6 diff methods)
       12523 (     ∞ of base) : System.Security.Cryptography.dasm - KeyFormatHelper:ReadEncryptedPkcs8(ref,ReadOnlyMemory`1,ReadOnlySpan`1,ReadOnlySpan`1,KeyReader`1,byref,byref) (0 base, 8 diff methods)
       11973 (45.36% of base) : Microsoft.Extensions.Logging.Console.dasm - JsonConsoleFormatter:Write(byref,IExternalScopeProvider,TextWriter):this (8 methods)
       11313 (     ∞ of base) : Microsoft.CodeAnalysis.dasm - UnionCollection`1:Create(ImmutableArray`1,Func`2):ICollection`1 (0 base, 64 diff methods)
       11264 (     ∞ of base) : System.Security.Cryptography.dasm - PemKeyHelpers:ImportEncryptedPem(ReadOnlySpan`1,ReadOnlySpan`1,ImportEncryptedKeyAction`1) (0 base, 8 diff methods)
       10543 (     ∞ of base) : Microsoft.CodeAnalysis.dasm - ImmutableArrayExtensions:WhereAsArray(ImmutableArray`1,Func`2):ImmutableArray`1 (0 base, 8 diff methods)
       10176 (65.45% of base) : System.Numerics.Tensors.dasm - CompressedSparseTensor`1:EnsureCapacity(int,int):this (8 methods)
        9996 (     ∞ of base) : Microsoft.CodeAnalysis.dasm - AnalyzerExecutor:ExecuteCodeBlockActionsCore(IEnumerable`1,IEnumerable`1,IEnumerable`1,DiagnosticAnalyzer,SyntaxNode,ISymbol,ImmutableArray`1,SemanticModel,Func`2,CodeBlockAnalyzerStateData):this (0 base, 6 diff methods)
        9422 (     ∞ of base) : System.Data.Common.dasm - SqlConvert:ChangeTypeForXML(Object,Type):Object (0 base, 1 diff methods)
        9263 (     ∞ of base) : Newtonsoft.Json.dasm - DynamicProxyMetaObject`1:BuildCallMethodWithResult(String,DynamicMetaObjectBinder,IEnumerable`1,DynamicMetaObject,Fallback):DynamicMetaObject:this (0 base, 8 diff methods)
        9072 (     ∞ of base) : Newtonsoft.Json.dasm - JToken:op_Explicit(JToken):Nullable`1 (0 base, 17 diff methods)
        9024 (     ∞ of base) : System.Data.Common.dasm - DataTable:DeserializeTableSchema(SerializationInfo,StreamingContext,bool):this (0 base, 1 diff methods)
        8905 (     ∞ of base) : System.Data.Common.dasm - RBTree`1:LeftRotate(int,int,int):int:this (0 base, 8 diff methods)
        8905 (     ∞ of base) : System.Data.Common.dasm - RBTree`1:RightRotate(int,int,int):int:this (0 base, 8 diff methods)
        8894 (     ∞ of base) : System.Data.Common.dasm - XmlTreeGen:SchemaTree(XmlDocument,XmlWriter,DataSet,DataTable,bool):this (0 base, 1 diff methods)
        8870 (     ∞ of base) : Microsoft.CodeAnalysis.dasm - ArrayBuilderExtensions:SelectAsArray(ArrayBuilder`1,Func`2):ImmutableArray`1 (0 base, 8 diff methods)
        8688 (     ∞ of base) : Newtonsoft.Json.dasm - JsonTextWriter:WriteValueAsync(Nullable`1,CancellationToken):Task:this (0 base, 17 diff methods)

Top method improvements (bytes):
       -5885 (-100.00% of base) : System.Formats.Tar.dasm - <TryGetNextHeaderAsync>d__43:MoveNext():this (1 base, 0 diff methods)
       -4577 (-100.00% of base) : System.Text.Json.dasm - JsonPropertyInfo`1:DetermineMemberAccessors(MemberInfo):this (8 base, 0 diff methods)
       -4296 (-100.00% of base) : System.Text.Json.dasm - ReflectionJsonTypeInfo`1:AddProperty(Type,MemberInfo,JsonSerializerOptions):JsonPropertyInfo:this (8 base, 0 diff methods)
       -4008 (-100.00% of base) : System.Text.Json.dasm - JsonPropertyInfo`1:.ctor(JsonPropertyInfoValues`1,JsonSerializerOptions):this (8 base, 0 diff methods)
       -3492 (-100.00% of base) : System.Formats.Tar.dasm - <TryGetNextEntryHeaderAsync>d__18:MoveNext():this (1 base, 0 diff methods)
       -3070 (-100.00% of base) : System.Formats.Tar.dasm - <TryProcessGnuMetadataHeaderAsync>d__22:MoveNext():this (1 base, 0 diff methods)
       -2795 (-100.00% of base) : System.Net.Http.dasm - <SendAsync>d__107:MoveNext():this (1 base, 0 diff methods)
       -2707 (-100.00% of base) : System.Net.Http.dasm - <ProcessOutgoingFramesAsync>d__79:MoveNext():this (1 base, 0 diff methods)
       -2702 (-100.00% of base) : System.Net.Http.dasm - <>c:<SendHeadersAsync>b__94_0(ValueTuple`5,Memory`1):bool:this (1 base, 0 diff methods)
       -2641 (-100.00% of base) : System.Formats.Tar.dasm - <WriteEntryAsyncInternal>d__23:MoveNext():this (1 base, 0 diff methods)
       -2426 (-100.00% of base) : System.Formats.Tar.dasm - <CreateFromDirectoryInternalAsync>d__11:MoveNext():this (1 base, 0 diff methods)
       -2383 (-86.91% of base) : System.Formats.Tar.dasm - TarHeader:WriteAsGnu(Stream,Span`1):this
       -2358 (-100.00% of base) : System.Formats.Tar.dasm - <WriteAsGnuAsync>d__79:MoveNext():this (1 base, 0 diff methods)
       -2166 (-100.00% of base) : System.Text.Json.dasm - ReflectionMemberAccessor:CreateAddMethodDelegate():Action`2:this (8 base, 0 diff methods)
       -2081 (-100.00% of base) : System.Formats.Tar.dasm - <GetNextEntryInternalAsync>d__16:MoveNext():this (1 base, 0 diff methods)
       -2080 (-100.00% of base) : System.Formats.Tar.dasm - <ExtractToDirectoryInternalAsync>d__17:MoveNext():this (1 base, 0 diff methods)
       -2011 (-100.00% of base) : System.Net.Http.dasm - <SendStreamDataAsync>d__95:MoveNext():this (1 base, 0 diff methods)
       -1997 (-100.00% of base) : System.Formats.Tar.dasm - <TryProcessExtendedAttributesHeaderAsync>d__20:MoveNext():this (1 base, 0 diff methods)
       -1986 (-100.00% of base) : System.Formats.Tar.dasm - TarWriter:ConstructEntryForWriting(String,String,int):TarEntry:this (1 base, 0 diff methods)
       -1957 (-100.00% of base) : System.Net.Http.dasm - <SendHeadersAsync>d__94:MoveNext():this (1 base, 0 diff methods)
       -1909 (-100.00% of base) : System.Formats.Tar.dasm - <CopyBytesAsync>d__10:MoveNext():this (1 base, 0 diff methods)
       -1868 (-100.00% of base) : System.Formats.Tar.dasm - <WriteAsUstarAsync>d__73:MoveNext():this (1 base, 0 diff methods)
       -1676 (-100.00% of base) : System.Formats.Tar.dasm - <WriteAsV7Async>d__71:MoveNext():this (1 base, 0 diff methods)
       -1596 (-100.00% of base) : System.Formats.Tar.dasm - <ExtractAsRegularFileAsync>d__47:MoveNext():this (1 base, 0 diff methods)
       -1554 (-100.00% of base) : System.Security.Cryptography.Pkcs.dasm - PkcsHelpers:CreateBestPkcs9AttributeObjectAvailable(Oid,ReadOnlySpan`1):Pkcs9AttributeObject (1 base, 0 diff methods)
       -1531 (-100.00% of base) : System.Formats.Tar.dasm - <ExtractToDirectoryInternalAsync>d__16:MoveNext():this (1 base, 0 diff methods)
       -1518 (-100.00% of base) : System.Formats.Tar.dasm - <CreateFromDirectoryInternalAsync>d__10:MoveNext():this (1 base, 0 diff methods)
       -1491 (-100.00% of base) : System.Formats.Tar.dasm - <WriteAsPaxInternalAsync>d__89:MoveNext():this (1 base, 0 diff methods)
       -1461 (-100.00% of base) : System.Formats.Tar.dasm - <AdvanceDataStreamIfNeededAsync>d__13:MoveNext():this (1 base, 0 diff methods)
       -1452 (-100.00% of base) : System.Formats.Tar.dasm - <GenerateExtendedAttributesDataStreamAsync>d__103:MoveNext():this (1 base, 0 diff methods)

Top method regressions (percentages):
         418 (     ∞ of base) : Microsoft.CodeAnalysis.dasm - _AppDomain:.cctor() (0 base, 1 diff methods)
         644 (     ∞ of base) : Microsoft.CodeAnalysis.dasm - _Assembly:.cctor() (0 base, 1 diff methods)
         148 (     ∞ of base) : Microsoft.CodeAnalysis.dasm - _CultureInfo:.cctor() (0 base, 1 diff methods)
         177 (     ∞ of base) : Microsoft.CodeAnalysis.dasm - _Module:.cctor() (0 base, 1 diff methods)
         214 (     ∞ of base) : Microsoft.CodeAnalysis.dasm - _ResolveEventArgs:.cctor() (0 base, 1 diff methods)
         250 (     ∞ of base) : Microsoft.CodeAnalysis.dasm - _RuntimeEnvironment:.cctor() (0 base, 1 diff methods)
        1082 (     ∞ of base) : Microsoft.CodeAnalysis.dasm - <<ComputeAnalyzerDiagnosticsAsync>b__1>d:MoveNext():this (0 base, 1 diff methods)
          28 (     ∞ of base) : Microsoft.CodeAnalysis.dasm - <<ComputeAnalyzerDiagnosticsAsync>b__1>d:SetStateMachine(IAsyncStateMachine):this (0 base, 1 diff methods)
        1248 (     ∞ of base) : Microsoft.CodeAnalysis.dasm - <<GetAnalyzerActionsAsync>b__0>d:MoveNext():this (0 base, 1 diff methods)
          47 (     ∞ of base) : Microsoft.CodeAnalysis.dasm - <<GetAnalyzerActionsAsync>b__0>d:SetStateMachine(IAsyncStateMachine):this (0 base, 1 diff methods)
         867 (     ∞ of base) : Newtonsoft.Json.dasm - <<InternalWriteEndAsync>g__AwaitEnd|11_2>d:MoveNext():this (0 base, 1 diff methods)
          28 (     ∞ of base) : Newtonsoft.Json.dasm - <<InternalWriteEndAsync>g__AwaitEnd|11_2>d:SetStateMachine(IAsyncStateMachine):this (0 base, 1 diff methods)
        1111 (     ∞ of base) : Newtonsoft.Json.dasm - <<InternalWriteEndAsync>g__AwaitIndent|11_1>d:MoveNext():this (0 base, 1 diff methods)
          28 (     ∞ of base) : Newtonsoft.Json.dasm - <<InternalWriteEndAsync>g__AwaitIndent|11_1>d:SetStateMachine(IAsyncStateMachine):this (0 base, 1 diff methods)
        1346 (     ∞ of base) : Newtonsoft.Json.dasm - <<InternalWriteEndAsync>g__AwaitProperty|11_0>d:MoveNext():this (0 base, 1 diff methods)
          28 (     ∞ of base) : Newtonsoft.Json.dasm - <<InternalWriteEndAsync>g__AwaitProperty|11_0>d:SetStateMachine(IAsyncStateMachine):this (0 base, 1 diff methods)
        1375 (     ∞ of base) : Newtonsoft.Json.dasm - <<InternalWriteEndAsync>g__AwaitRemaining|11_3>d:MoveNext():this (0 base, 1 diff methods)
          28 (     ∞ of base) : Newtonsoft.Json.dasm - <<InternalWriteEndAsync>g__AwaitRemaining|11_3>d:SetStateMachine(IAsyncStateMachine):this (0 base, 1 diff methods)
        1235 (     ∞ of base) : Newtonsoft.Json.dasm - <<WriteToAsync>g__AwaitProperties|0_0>d:MoveNext():this (0 base, 1 diff methods)
          28 (     ∞ of base) : Newtonsoft.Json.dasm - <<WriteToAsync>g__AwaitProperties|0_0>d:SetStateMachine(IAsyncStateMachine):this (0 base, 1 diff methods)
         284 (     ∞ of base) : System.Data.Common.dasm - <>c:.cctor() (0 base, 4 diff methods)
         852 (     ∞ of base) : System.Security.Cryptography.dasm - <>c:.cctor() (0 base, 12 diff methods)
          71 (     ∞ of base) : System.Runtime.Numerics.dasm - <>c:.cctor() (0 base, 1 diff methods)
        7116 (     ∞ of base) : Microsoft.CodeAnalysis.dasm - <>c:.cctor() (0 base, 100 diff methods)
        2209 (     ∞ of base) : Newtonsoft.Json.dasm - <>c:.cctor() (0 base, 31 diff methods)
           4 (     ∞ of base) : System.Data.Common.dasm - <>c:.ctor():this (0 base, 4 diff methods)
          12 (     ∞ of base) : System.Security.Cryptography.dasm - <>c:.ctor():this (0 base, 12 diff methods)
           1 (     ∞ of base) : System.Runtime.Numerics.dasm - <>c:.ctor():this (0 base, 1 diff methods)
         100 (     ∞ of base) : Microsoft.CodeAnalysis.dasm - <>c:.ctor():this (0 base, 100 diff methods)
          31 (     ∞ of base) : Newtonsoft.Json.dasm - <>c:.ctor():this (0 base, 31 diff methods)

Top method improvements (percentages):
          -6 (-100.00% of base) : System.Net.Http.dasm - <>c:<FlushAsync>b__75_0(int,Memory`1):bool:this (1 base, 0 diff methods)
        -336 (-100.00% of base) : System.Text.Json.dasm - <>c:<MapInterfaceTypesToCallbacks>b__11_0(Object):this (8 base, 0 diff methods)
        -336 (-100.00% of base) : System.Text.Json.dasm - <>c:<MapInterfaceTypesToCallbacks>b__11_1(Object):this (8 base, 0 diff methods)
        -336 (-100.00% of base) : System.Text.Json.dasm - <>c:<MapInterfaceTypesToCallbacks>b__11_2(Object):this (8 base, 0 diff methods)
        -336 (-100.00% of base) : System.Text.Json.dasm - <>c:<MapInterfaceTypesToCallbacks>b__11_3(Object):this (8 base, 0 diff methods)
        -340 (-100.00% of base) : System.Net.Http.dasm - <>c:<SendEndStreamAsync>b__96_0(ValueTuple`2,Memory`1):bool:this (1 base, 0 diff methods)
       -2702 (-100.00% of base) : System.Net.Http.dasm - <>c:<SendHeadersAsync>b__94_0(ValueTuple`5,Memory`1):bool:this (1 base, 0 diff methods)
        -757 (-100.00% of base) : System.Net.Http.dasm - <>c:<SendPingAsync>b__81_0(ValueTuple`3,Memory`1):bool:this (1 base, 0 diff methods)
        -827 (-100.00% of base) : System.Net.Http.dasm - <>c:<SendRstStreamAsync>b__82_0(ValueTuple`3,Memory`1):bool:this (1 base, 0 diff methods)
        -324 (-100.00% of base) : System.Net.Http.dasm - <>c:<SendSettingsAckAsync>b__80_0(Http2Connection,Memory`1):bool:this (1 base, 0 diff methods)
       -1183 (-100.00% of base) : System.Net.Http.dasm - <>c:<SendStreamDataAsync>b__95_0(ValueTuple`4,Memory`1):bool:this (1 base, 0 diff methods)
        -827 (-100.00% of base) : System.Net.Http.dasm - <>c:<SendWindowUpdateAsync>b__97_0(ValueTuple`3,Memory`1):bool:this (1 base, 0 diff methods)
          -8 (-100.00% of base) : System.Text.Json.dasm - <>c__DisplayClass10_0:.ctor():this (8 base, 0 diff methods)
        -642 (-100.00% of base) : System.Text.Json.dasm - <>c__DisplayClass10_0:<SetSetter>b__0(Object,Object):this (8 base, 0 diff methods)
          -8 (-100.00% of base) : System.Text.Json.dasm - <>c__DisplayClass10_0`1:.ctor():this (8 base, 0 diff methods)
         -68 (-100.00% of base) : System.Text.Json.dasm - <>c__DisplayClass10_0`1:<CreateFieldSetter>b__0(Object,__Canon):this (1 base, 0 diff methods)
        -108 (-100.00% of base) : System.Text.Json.dasm - <>c__DisplayClass10_0`1:<CreateFieldSetter>b__0(Object,double):this (1 base, 0 diff methods)
         -96 (-100.00% of base) : System.Text.Json.dasm - <>c__DisplayClass10_0`1:<CreateFieldSetter>b__0(Object,int):this (1 base, 0 diff methods)
         -97 (-100.00% of base) : System.Text.Json.dasm - <>c__DisplayClass10_0`1:<CreateFieldSetter>b__0(Object,long):this (1 base, 0 diff methods)
         -94 (-100.00% of base) : System.Text.Json.dasm - <>c__DisplayClass10_0`1:<CreateFieldSetter>b__0(Object,Nullable`1):this (1 base, 0 diff methods)
         -97 (-100.00% of base) : System.Text.Json.dasm - <>c__DisplayClass10_0`1:<CreateFieldSetter>b__0(Object,short):this (1 base, 0 diff methods)
         -96 (-100.00% of base) : System.Text.Json.dasm - <>c__DisplayClass10_0`1:<CreateFieldSetter>b__0(Object,ubyte):this (1 base, 0 diff methods)
        -108 (-100.00% of base) : System.Text.Json.dasm - <>c__DisplayClass10_0`1:<CreateFieldSetter>b__0(Object,Vector`1):this (1 base, 0 diff methods)
          -8 (-100.00% of base) : System.Text.Json.dasm - <>c__DisplayClass10_1:.ctor():this (8 base, 0 diff methods)
         -12 (-100.00% of base) : System.Text.Json.dasm - <>c__DisplayClass10_1:<SetSetter>b__1(Object,__Canon):this (1 base, 0 diff methods)
         -71 (-100.00% of base) : System.Text.Json.dasm - <>c__DisplayClass10_1:<SetSetter>b__1(Object,double):this (1 base, 0 diff methods)
         -59 (-100.00% of base) : System.Text.Json.dasm - <>c__DisplayClass10_1:<SetSetter>b__1(Object,int):this (1 base, 0 diff methods)
         -60 (-100.00% of base) : System.Text.Json.dasm - <>c__DisplayClass10_1:<SetSetter>b__1(Object,long):this (1 base, 0 diff methods)
         -59 (-100.00% of base) : System.Text.Json.dasm - <>c__DisplayClass10_1:<SetSetter>b__1(Object,Nullable`1):this (1 base, 0 diff methods)
         -60 (-100.00% of base) : System.Text.Json.dasm - <>c__DisplayClass10_1:<SetSetter>b__1(Object,short):this (1 base, 0 diff methods)

34230 total methods with Code Size differences (390 improved, 33840 regressed), 220356 unchanged.

So looks like the regression is properly fixed

@EgorBo EgorBo deleted the custom-layout branch July 6, 2022 09:55
@tannergooding
Copy link
Member

Yeah, looks like it.

There is still some difference with a total net of -143,872 between the two, but that's a good diff. It would be nice to know where that change is coming from overall since it will help with perf triage.

@AndyAyersMS
Copy link
Member

another regression: #71673

@AaronRobinsonMSFT
Copy link
Member

@AndyAyersMS I think that is a self-referencing link :-)

@AndyAyersMS
Copy link
Member

So it is... sadly I can't find the actual issue I meant to link.

@ghost ghost locked as resolved and limited conversation to collaborators Aug 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Widespread regressions after #71498 (Spans to use ref fields)
6 participants