Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

@AndyAyersMS
Copy link
Member

In particular, avoid the array store check when storing null or values from
the same array.

Addresses first part of #14574.

In particular, avoid the array store check when storing null or values from
the same array.

Addresses first part of #14574.
@AndyAyersMS
Copy link
Member Author

@briansull PTAL
cc @dotnet/jit-contrib

As expected, diffs are in generic code in sorting or swapping methods. jit-diffs shows some size increases; the store element helper does the bounds check and computes the element address while the write barrier just does the store.

Total bytes of diff: 168 (0.00 % of base)
    diff is a regression.
Total byte diff includes 0 bytes from reconciling methods
        Base had    0 unique methods,        0 unique bytes
        Diff had    0 unique methods,        0 unique bytes
Top file regressions by size (bytes):
         122 : System.Private.CoreLib.dasm (0.00 % of base)
          45 : System.Collections.dasm (0.04 % of base)
           1 : System.Collections.Immutable.dasm (0.00 % of base)
3 total files with size differences (0 improved, 3 regressed), 127 unchanged.
Top method regessions by size (bytes):
          45 : System.Collections.dasm - System.Collections.Generic.SortedSet`1[__Canon][System.__Canon]:.ctor(ref,ref):this
          35 : System.Private.CoreLib.dasm - System.Collections.Generic.GenericArraySortHelper`2[__Canon,__Canon][System.__Canon,System.__Canon]:InsertionSort(ref,ref,int,int)
          32 : System.Private.CoreLib.dasm - System.Collections.Generic.ArraySortHelper`2[__Canon,__Canon][System.__Canon,System.__Canon]:InsertionSort(ref,ref,int,int,ref)
          24 : System.Private.CoreLib.dasm - System.Collections.Generic.GenericArraySortHelper`1[__Canon][System.__Canon]:InsertionSort(ref,int,int)
          14 : System.Private.CoreLib.dasm - System.Collections.Generic.GenericArraySortHelper`2[__Canon,__Canon][System.__Canon,System.__Canon]:DownHeap(ref,ref,int,int,int)
Top method improvements by size (bytes):
         -14 : System.Private.CoreLib.dasm - System.Collections.Generic.ArraySortHelper`2[__Canon,__Canon][System.__Canon,System.__Canon]:SwapIfGreaterWithItems(ref,ref,ref,int,int)
          -4 : System.Private.CoreLib.dasm - System.Collections.Generic.ArraySortHelper`1[__Canon][System.__Canon]:SwapIfGreater(ref,ref,int,int)
          -4 : System.Private.CoreLib.dasm - System.Collections.Generic.ArraySortHelper`1[__Canon][System.__Canon]:Swap(ref,int,int)
          -4 : System.Private.CoreLib.dasm - System.Collections.Generic.GenericArraySortHelper`1[__Canon][System.__Canon]:SwapIfGreaterWithItems(ref,int,int)
          -4 : System.Private.CoreLib.dasm - System.Collections.Generic.GenericArraySortHelper`1[__Canon][System.__Canon]:Swap(ref,int,int)
22 total methods with size differences (8 improved, 14 regressed), 142893 unchanged.

Copy link

@briansull briansull left a comment

Choose a reason for hiding this comment

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

Looks Good

@jkotas jkotas merged commit 861b654 into dotnet:master Oct 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants