0

Support fast tailcalls in R2R by jakobbotsch · Pull Request #56669 · dotnet/runt...

 2 years ago
source link: https://github.com/dotnet/runtime/pull/56669
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Copy link

Member

Author

jakobbotsch commented 14 days ago

FWIW, the FSharp.Core.dll diffs look like the following. It indicates that ~1100 more functions were crossgenned.

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 794036
Total bytes of diff: 977634
Total bytes of delta: 183598 (23.12% of base)
Total relative delta: -44.35
    diff is a regression.
    relative diff is an improvement.


Total byte diff includes 181609 bytes from reconciling methods
        Base had    0 unique methods,        0 unique bytes
        Diff had 1088 unique methods,   181609 unique bytes

Top file regressions (bytes):
      183598 : FSharp.Core.dasm (23.12% of base)

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

Top method regressions (bytes):
       11879 (     ∞ of base) : FSharp.Core.dasm - Microsoft.FSharp.Quotations.FSharpExpr:GetLayout(bool):Microsoft.FSharp.Text.StructuredPrintfImpl.Layout:this (0 base, 1 diff methods)
        9060 (     ∞ of base) : FSharp.Core.dasm - HashCompare:GenericEqualityObj$cont@1336(bool,System.Collections.IEqualityComparer,System.Object,System.Object,System.Array,Microsoft.FSharp.Core.Unit):bool (0 base, 1 diff methods)
        6959 (     ∞ of base) : FSharp.Core.dasm - Microsoft.FSharp.Linq.QueryModule:EvalNonNestedOuter(int,Microsoft.FSharp.Quotations.FSharpExpr):System.Object (0 base, 1 diff methods)
        5828 (     ∞ of base) : FSharp.Core.dasm - Microsoft.FSharp.Linq.QueryModule:TransNestedOuter(int,Microsoft.FSharp.Quotations.FSharpExpr):Microsoft.FSharp.Quotations.FSharpExpr (0 base, 1 diff methods)
        4026 (     ∞ of base) : FSharp.Core.dasm - Microsoft.FSharp.Collections.FSharpMap`2:ToString():System.String:this (0 base, 3 diff methods)
        2353 (     ∞ of base) : FSharp.Core.dasm - <StartupCode$FSharp-Core>.$Quotations:eq@197(Microsoft.FSharp.Quotations.Tree,Microsoft.FSharp.Quotations.Tree):bool (0 base, 1 diff methods)
        2047 (     ∞ of base) : FSharp.Core.dasm - MakeGroupJoin@955:Invoke(System.Tuple`8[System.Boolean, System.Type, System.Type, System.Type, System.Type, Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Quotations.FSharpExpr, System.Tuple`7[Microsoft.FSharp.Quotations.FSharpVar, Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Quotations.FSharpVar, Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Quotations.FSharpVar, Microsoft.FSharp.Quotations.FSharpVar, Microsoft.FSharp.Quotations.FSharpExpr]]):Microsoft.FSharp.Quotations.FSharpExpr:this (0 base, 1 diff methods)
        1961 (     ∞ of base) : FSharp.Core.dasm - Microsoft.FSharp.Collections.FSharpList`1:ToString():System.String:this (0 base, 2 diff methods)
        1960 (     ∞ of base) : FSharp.Core.dasm - MakeJoin@939:Invoke(System.Tuple`8[System.Boolean, System.Type, System.Type, System.Type, System.Type, Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Quotations.FSharpExpr, System.Tuple`7[Microsoft.FSharp.Quotations.FSharpVar, Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Quotations.FSharpVar, Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Quotations.FSharpVar, Microsoft.FSharp.Quotations.FSharpVar, Microsoft.FSharp.Quotations.FSharpExpr]]):Microsoft.FSharp.Quotations.FSharpExpr:this (0 base, 1 diff methods)
        1882 (     ∞ of base) : FSharp.Core.dasm - Microsoft.FSharp.Core.FSharpOption`1:Equals(System.Object,System.Collections.IEqualityComparer):bool:this (0 base, 14 diff methods)
        1862 (     ∞ of base) : FSharp.Core.dasm - Microsoft.FSharp.Core.FSharpOption`1:CompareTo(System.Object,System.Collections.IComparer):int:this (0 base, 14 diff methods)
        1779 (     ∞ of base) : FSharp.Core.dasm - <StartupCode$FSharp-Core>.$Quotations:Equals$cont@145-6(Microsoft.FSharp.Quotations.ExprConstInfo,Microsoft.FSharp.Quotations.ExprConstInfo,System.Collections.IEqualityComparer,Microsoft.FSharp.Core.Unit):bool (0 base, 1 diff methods)
        1659 (     ∞ of base) : FSharp.Core.dasm - Microsoft.FSharp.Quotations.PatternsModule:typeOf(System.__Canon):System.Type (0 base, 1 diff methods)
        1656 (     ∞ of base) : FSharp.Core.dasm - <StartupCode$FSharp-Core>.$Quotations:Equals$cont@145-8(Microsoft.FSharp.Quotations.ExprConstInfo,Microsoft.FSharp.Quotations.ExprConstInfo,Microsoft.FSharp.Core.Unit):bool (0 base, 1 diff methods)
        1655 (     ∞ of base) : FSharp.Core.dasm - Microsoft.FSharp.Linq.RuntimeHelpers.Adapters:ConvImmutableTypeToMutableType(Microsoft.FSharp.Linq.RuntimeHelpers.Adapters+ConversionDescription,System.Type):System.Type (0 base, 1 diff methods)
        1461 (     ∞ of base) : FSharp.Core.dasm - Microsoft.FSharp.Linq.QueryModule:ConvMutableToImmutable(Microsoft.FSharp.Linq.RuntimeHelpers.Adapters+ConversionDescription,Microsoft.FSharp.Quotations.FSharpExpr):Microsoft.FSharp.Quotations.FSharpExpr (0 base, 1 diff methods)
        1435 (     ∞ of base) : FSharp.Core.dasm - Microsoft.FSharp.Reflection.Impl:mkTupleType(bool,System.Reflection.Assembly,System.Type[]):System.Type (0 base, 1 diff methods)
        1362 (     ∞ of base) : FSharp.Core.dasm - Microsoft.FSharp.Linq.QueryModule:Make@575-3(bool,Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[Microsoft.FSharp.Collections.FSharpList`1[System.Type], Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]], Microsoft.FSharp.Quotations.FSharpExpr],Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[Microsoft.FSharp.Collections.FSharpList`1[System.Type], Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]], Microsoft.FSharp.Quotations.FSharpExpr],Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[Microsoft.FSharp.Collections.FSharpList`1[System.Type], Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]], Microsoft.FSharp.Quotations.FSharpExpr],Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[Microsoft.FSharp.Collections.FSharpList`1[System.Type], Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]], Microsoft.FSharp.Quotations.FSharpExpr],Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[Microsoft.FSharp.Collections.FSharpList`1[System.Type], Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]], Microsoft.FSharp.Quotations.FSharpExpr],Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[Microsoft.FSharp.Collections.FSharpList`1[System.Type], Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]], Microsoft.FSharp.Quotations.FSharpExpr],Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[Microsoft.FSharp.Collections.FSharpList`1[System.Type], Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]], Microsoft.FSharp.Quotations.FSharpExpr],Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[Microsoft.FSharp.Collections.FSharpList`1[System.Type], Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]], Microsoft.FSharp.Quotations.FSharpExpr],Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[Microsoft.FSharp.Collections.FSharpList`1[System.Type], Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]], Microsoft.FSharp.Quotations.FSharpExpr],Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[Microsoft.FSharp.Collections.FSharpList`1[System.Type], Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]], Microsoft.FSharp.Quotations.FSharpExpr],Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`3[Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Collections.FSharpList`1[System.Type], Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Quotations.FSharpExpr]], Microsoft.FSharp.Quotations.FSharpExpr],Microsoft.FSharp.Quotations.FSharpExpr,bool,Microsoft.FSharp.Quotations.FSharpExpr,Microsoft.FSharp.Quotations.FSharpVar,Microsoft.FSharp.Quotations.FSharpExpr):Microsoft.FSharp.Quotations.FSharpExpr (0 base, 1 diff methods)
        1312 (     ∞ of base) : FSharp.Core.dasm - MakeSelectMany@793:Invoke(System.Tuple`7[System.Boolean, System.Type, Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Quotations.FSharpVar, Microsoft.FSharp.Quotations.FSharpExpr, Microsoft.FSharp.Quotations.FSharpVar, Microsoft.FSharp.Quotations.FSharpExpr]):Microsoft.FSharp.Quotations.FSharpExpr:this (0 base, 1 diff methods)
        1240 (     ∞ of base) : FSharp.Core.dasm - PrintfEnv`3:RunSteps(System.Object[],System.Type[],Microsoft.FSharp.Core.PrintfImpl+Step[]):System.__Canon:this (0 base, 1 diff methods)

Top method improvements (bytes):
         -24 (-23.53% of base) : FSharp.Core.dasm - Microsoft.FSharp.Control.AsyncActivation`1:get_IsCancellationRequested():bool:this (3 methods)
         -20 (-32.26% of base) : FSharp.Core.dasm - mkSeq@132:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this (2 methods)
         -18 (-19.78% of base) : FSharp.Core.dasm - Microsoft.FSharp.Collections.FSharpMap`2:ContainsKey(int):bool:this (2 methods)
         -18 (-33.33% of base) : FSharp.Core.dasm - Microsoft.FSharp.Collections.FSharpMap`2:GetHashCode():int:this (3 methods)
         -18 (-19.78% of base) : FSharp.Core.dasm - Microsoft.FSharp.Collections.FSharpMap`2:System.Collections.Generic.IDictionary<'Key, 'Value>.ContainsKey(int):bool:this (2 methods)
         -18 (-17.31% of base) : FSharp.Core.dasm - Microsoft.FSharp.Collections.FSharpMap`2:System.Collections.Generic.IDictionary<'Key, 'Value>.TryGetValue(int,byref):bool:this (2 methods)
         -18 (-19.78% of base) : FSharp.Core.dasm - Microsoft.FSharp.Collections.FSharpMap`2:System.Collections.Generic.IReadOnlyDictionary<'Key, 'Value>.ContainsKey(int):bool:this (2 methods)
         -18 (-17.31% of base) : FSharp.Core.dasm - Microsoft.FSharp.Collections.FSharpMap`2:System.Collections.Generic.IReadOnlyDictionary<'Key, 'Value>.TryGetValue(int,byref):bool:this (2 methods)
         -18 (-17.31% of base) : FSharp.Core.dasm - Microsoft.FSharp.Collections.FSharpMap`2:TryGetValue(int,byref):bool:this (2 methods)
         -16 (-47.06% of base) : FSharp.Core.dasm - Microsoft.FSharp.Collections.FSharpMap`2:get_Item(int):int:this
         -16 (-47.06% of base) : FSharp.Core.dasm - Microsoft.FSharp.Collections.FSharpMap`2:System.Collections.Generic.IDictionary<'Key, 'Value>.get_Item(int):int:this
         -16 (-47.06% of base) : FSharp.Core.dasm - Microsoft.FSharp.Collections.FSharpMap`2:System.Collections.Generic.IReadOnlyDictionary<'Key, 'Value>.get_Item(int):int:this
         -16 (-41.03% of base) : FSharp.Core.dasm - Microsoft.FSharp.Reflection.UnionCaseInfo:GetFields():System.Reflection.PropertyInfo[]:this
         -16 (-41.03% of base) : FSharp.Core.dasm - Microsoft.FSharp.Reflection.UnionCaseInfo:getMethInfo():System.Reflection.MethodInfo:this
         -16 (-43.24% of base) : FSharp.Core.dasm - RangeByte@5429-1:System.Collections.Generic.IEnumerable<System.Byte>.GetEnumerator():System.Collections.Generic.IEnumerator`1[System.Byte]:this
         -16 (-43.24% of base) : FSharp.Core.dasm - RangeByte@5429-1:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
         -16 (-41.03% of base) : FSharp.Core.dasm - RangeInt16@5426-1:System.Collections.Generic.IEnumerable<System.Int16>.GetEnumerator():System.Collections.Generic.IEnumerator`1[System.Int16]:this
         -16 (-41.03% of base) : FSharp.Core.dasm - RangeInt16@5426-1:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
         -16 (-45.71% of base) : FSharp.Core.dasm - RangeInt32@5420-1:System.Collections.Generic.IEnumerable<System.Int32>.GetEnumerator():System.Collections.Generic.IEnumerator`1[System.Int32]:this
         -16 (-45.71% of base) : FSharp.Core.dasm - RangeInt32@5420-1:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this

Top method regressions (percentages):
          21 (     ∞ of base) : FSharp.Core.dasm - |RecordFieldGetSimplification|_|@170:Invoke(System.Reflection.PropertyInfo):bool:this (0 base, 1 diff methods)
        2353 (     ∞ of base) : FSharp.Core.dasm - <StartupCode$FSharp-Core>.$Quotations:eq@197(Microsoft.FSharp.Quotations.Tree,Microsoft.FSharp.Quotations.Tree):bool (0 base, 1 diff methods)
         360 (     ∞ of base) : FSharp.Core.dasm - <StartupCode$FSharp-Core>.$Quotations:Equals$cont@137-5(Microsoft.FSharp.Quotations.Tree,Microsoft.FSharp.Quotations.Tree,System.Collections.IEqualityComparer,Microsoft.FSharp.Core.Unit):bool (0 base, 1 diff methods)
         366 (     ∞ of base) : FSharp.Core.dasm - <StartupCode$FSharp-Core>.$Quotations:Equals$cont@137-7(Microsoft.FSharp.Quotations.Tree,Microsoft.FSharp.Quotations.Tree,Microsoft.FSharp.Core.Unit):bool (0 base, 1 diff methods)
        1779 (     ∞ of base) : FSharp.Core.dasm - <StartupCode$FSharp-Core>.$Quotations:Equals$cont@145-6(Microsoft.FSharp.Quotations.ExprConstInfo,Microsoft.FSharp.Quotations.ExprConstInfo,System.Collections.IEqualityComparer,Microsoft.FSharp.Core.Unit):bool (0 base, 1 diff methods)
        1656 (     ∞ of base) : FSharp.Core.dasm - <StartupCode$FSharp-Core>.$Quotations:Equals$cont@145-8(Microsoft.FSharp.Quotations.ExprConstInfo,Microsoft.FSharp.Quotations.ExprConstInfo,Microsoft.FSharp.Core.Unit):bool (0 base, 1 diff methods)
          17 (     ∞ of base) : FSharp.Core.dasm - a@1498:Invoke(Microsoft.FSharp.Quotations.FSharpExpr):System.Type:this (0 base, 1 diff methods)
          17 (     ∞ of base) : FSharp.Core.dasm - a@1498-1:Invoke(Microsoft.FSharp.Quotations.FSharpExpr):System.Type:this (0 base, 1 diff methods)
          16 (     ∞ of base) : FSharp.Core.dasm - aboveListL@284:Invoke(Microsoft.FSharp.Text.StructuredPrintfImpl.Layout,Microsoft.FSharp.Text.StructuredPrintfImpl.Layout):Microsoft.FSharp.Text.StructuredPrintfImpl.Layout:this (0 base, 1 diff methods)
          44 (     ∞ of base) : FSharp.Core.dasm - action@647-12:Invoke(Microsoft.FSharp.Core.Unit):Microsoft.FSharp.Control.AsyncReturn:this (0 base, 1 diff methods)
          52 (     ∞ of base) : FSharp.Core.dasm - Adapt@3242:Invoke(int,int):bool:this (0 base, 1 diff methods)
          53 (     ∞ of base) : FSharp.Core.dasm - Adapt@3242:Invoke(int,ushort):ushort:this (0 base, 1 diff methods)
          53 (     ∞ of base) : FSharp.Core.dasm - Adapt@3242:Invoke(System.__Canon,System.__Canon):System.__Canon:this (0 base, 1 diff methods)
          53 (     ∞ of base) : FSharp.Core.dasm - Adapt@3257-1:Invoke(System.__Canon,System.__Canon,System.__Canon):System.__Canon:this (0 base, 1 diff methods)
          93 (     ∞ of base) : FSharp.Core.dasm - Adapt@3260-2:Invoke(System.__Canon,System.__Canon,System.__Canon):System.__Canon:this (0 base, 1 diff methods)
          50 (     ∞ of base) : FSharp.Core.dasm - Adapt@3274-3:Invoke(System.__Canon,System.__Canon,System.__Canon,System.__Canon):System.__Canon:this (0 base, 1 diff methods)
         101 (     ∞ of base) : FSharp.Core.dasm - Adapt@3279-4:Invoke(System.__Canon,System.__Canon,System.__Canon,System.__Canon):System.__Canon:this (0 base, 1 diff methods)
         109 (     ∞ of base) : FSharp.Core.dasm - Adapt@3282-5:Invoke(System.__Canon,System.__Canon,System.__Canon,System.__Canon):System.__Canon:this (0 base, 1 diff methods)
          60 (     ∞ of base) : FSharp.Core.dasm - Adapt@3299-6:Invoke(System.__Canon,System.__Canon,System.__Canon,System.__Canon,System.__Canon):System.__Canon:this (0 base, 1 diff methods)
         109 (     ∞ of base) : FSharp.Core.dasm - Adapt@3304-7:Invoke(System.__Canon,System.__Canon,System.__Canon,System.__Canon,System.__Canon):System.__Canon:this (0 base, 1 diff methods)

Top method improvements (percentages):
         -16 (-47.06% of base) : FSharp.Core.dasm - Microsoft.FSharp.Collections.FSharpMap`2:get_Item(int):int:this
         -16 (-47.06% of base) : FSharp.Core.dasm - Microsoft.FSharp.Collections.FSharpMap`2:System.Collections.Generic.IDictionary<'Key, 'Value>.get_Item(int):int:this
         -16 (-47.06% of base) : FSharp.Core.dasm - Microsoft.FSharp.Collections.FSharpMap`2:System.Collections.Generic.IReadOnlyDictionary<'Key, 'Value>.get_Item(int):int:this
         -16 (-45.71% of base) : FSharp.Core.dasm - RangeInt32@5420-1:System.Collections.Generic.IEnumerable<System.Int32>.GetEnumerator():System.Collections.Generic.IEnumerator`1[System.Int32]:this
         -16 (-45.71% of base) : FSharp.Core.dasm - RangeInt32@5420-1:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
         -16 (-45.71% of base) : FSharp.Core.dasm - RangeUInt32@5423-1:System.Collections.Generic.IEnumerable<System.UInt32>.GetEnumerator():System.Collections.Generic.IEnumerator`1[System.UInt32]:this
         -16 (-45.71% of base) : FSharp.Core.dasm - RangeUInt32@5423-1:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
         -13 (-44.83% of base) : FSharp.Core.dasm - -cctor@6137-17:Invoke(System.Decimal):System.Decimal:this
         -16 (-43.24% of base) : FSharp.Core.dasm - RangeByte@5429-1:System.Collections.Generic.IEnumerable<System.Byte>.GetEnumerator():System.Collections.Generic.IEnumerator`1[System.Byte]:this
         -16 (-43.24% of base) : FSharp.Core.dasm - RangeByte@5429-1:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
         -16 (-43.24% of base) : FSharp.Core.dasm - RangeInt64@5421-1:System.Collections.Generic.IEnumerable<System.Int64>.GetEnumerator():System.Collections.Generic.IEnumerator`1[System.Int64]:this
         -16 (-43.24% of base) : FSharp.Core.dasm - RangeInt64@5421-1:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
         -16 (-43.24% of base) : FSharp.Core.dasm - RangeUInt16@5427-1:System.Collections.Generic.IEnumerable<System.UInt16>.GetEnumerator():System.Collections.Generic.IEnumerator`1[System.UInt16]:this
         -16 (-43.24% of base) : FSharp.Core.dasm - RangeUInt16@5427-1:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
         -16 (-43.24% of base) : FSharp.Core.dasm - RangeUInt64@5422-1:System.Collections.Generic.IEnumerable<System.UInt64>.GetEnumerator():System.Collections.Generic.IEnumerator`1[System.UInt64]:this
         -16 (-43.24% of base) : FSharp.Core.dasm - RangeUInt64@5422-1:System.Collections.IEnumerable.GetEnumerator():System.Collections.IEnumerator:this
         -16 (-43.24% of base) : FSharp.Core.dasm - substargs@1760:Invoke(Microsoft.FSharp.Quotations.FSharpExpr):Microsoft.FSharp.Quotations.FSharpExpr:this
         -16 (-41.03% of base) : FSharp.Core.dasm - Microsoft.FSharp.Reflection.UnionCaseInfo:GetFields():System.Reflection.PropertyInfo[]:this
         -16 (-41.03% of base) : FSharp.Core.dasm - Microsoft.FSharp.Reflection.UnionCaseInfo:getMethInfo():System.Reflection.MethodInfo:this
         -16 (-41.03% of base) : FSharp.Core.dasm - RangeInt16@5426-1:System.Collections.Generic.IEnumerable<System.Int16>.GetEnumerator():System.Collections.Generic.IEnumerator`1[System.Int16]:this

2309 total methods with Code Size differences (288 improved, 2021 regressed), 5307 unchanged.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK