Skip to content

[JitDiff X64] [EgorBo] Remove some bounds checks around Vector.Create(Span) #1023

Open
@MihuBot

Description

@MihuBot

Job completed in 15 minutes 15 seconds (remote runner delay: 1 minute 12 seconds).
dotnet/runtime#113035

Diffs

Diffs
Found 85 files with textual diffs.

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 43801115
Total bytes of diff: 43803293
Total bytes of delta: 2178 (0.00 % of base)
Total relative delta: 15.01
    diff is a regression.
    relative diff is a regression.


Top file regressions (bytes):
        1277 : System.Net.Sockets.dasm (0.48 % of base)
         985 : System.Net.Primitives.dasm (0.96 % of base)

Top file improvements (bytes):
         -84 : System.Private.CoreLib.dasm (-0.00 % of base)

3 total files with Code Size differences (1 improved, 2 regressed), 260 unchanged.

Top method regressions (bytes):
         191 (32.21 % of base) : System.Net.Primitives.dasm - System.Net.IPNetwork:Contains(System.Net.IPAddress):ubyte:this (FullOpts)
         116 (232.00 % of base) : System.Net.Primitives.dasm - System.Net.IPNetwork:Equals(System.Net.IPNetwork):ubyte:this (FullOpts)
         106 (179.66 % of base) : System.Net.Primitives.dasm - System.Net.IPNetwork:op_Equality(System.Net.IPNetwork,System.Net.IPNetwork):ubyte (FullOpts)
          99 (30.65 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.UdpClient:EndReceive(System.IAsyncResult,byref):ubyte[]:this (FullOpts)
          97 (20.00 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.UdpClient:.ctor(int,int):this (FullOpts)
          94 (97.92 % of base) : System.Net.Primitives.dasm - System.Net.IPNetwork:Equals(System.Object):ubyte:this (FullOpts)
          94 (37.90 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.UdpClient:ReceiveAsync(System.Threading.CancellationToken):System.Threading.Tasks.ValueTask`1[System.Net.Sockets.UdpReceiveResult]:this (FullOpts)
          92 (27.71 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.UdpClient:Receive(byref):ubyte[]:this (FullOpts)
          92 (23.59 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.UdpClient:ReceiveAsync():System.Threading.Tasks.Task`1[System.Net.Sockets.UdpReceiveResult]:this (FullOpts)
          91 (108.33 % of base) : System.Net.Primitives.dasm - System.Net.IPNetwork:op_Inequality(System.Net.IPNetwork,System.Net.IPNetwork):ubyte (FullOpts)
          90 (48.91 % of base) : System.Net.Primitives.dasm - System.Net.IPAddress:IsLoopback(System.Net.IPAddress):ubyte (FullOpts)
          89 (61.38 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.UdpClient:BeginReceive(System.AsyncCallback,System.Object):System.IAsyncResult:this (FullOpts)
          83 (48.54 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.Socket:IsWildcardEndPoint(System.Net.EndPoint):ubyte (FullOpts)
          59 (147.50 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.UdpClient:IsBroadcast(System.Net.IPAddress):ubyte (FullOpts)
          57 (123.91 % of base) : System.Net.Primitives.dasm - System.Net.IPNetwork:GetHashCode():int:this (FullOpts)
          54 (16.62 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.Socket:SetReceivingPacketInformation():this (FullOpts)
          51 (20.73 % of base) : System.Net.Primitives.dasm - System.Net.IPNetwork:TryFormat(System.Span`1[ubyte],byref):ubyte:this (FullOpts)
          51 (21.52 % of base) : System.Net.Primitives.dasm - System.Net.IPNetwork:TryFormat(System.Span`1[ushort],byref):ubyte:this (FullOpts)
          51 (60.71 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.MulticastOption:.ctor(System.Net.IPAddress):this (FullOpts)
          51 (20.56 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.TcpListener:.ctor(int):this (FullOpts)
          48 (30.77 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.Socket:.cctor() (FullOpts)
          47 (16.79 % of base) : System.Net.Primitives.dasm - System.Net.IPNetwork:ToString():System.String:this (FullOpts)
          47 (2.67 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.Socket:ReceiveFrom(ubyte[],int,int,int,byref):int:this (FullOpts)
          47 (4.93 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.Socket:ReceiveFromAsync(System.Net.Sockets.SocketAsyncEventArgs,System.Threading.CancellationToken):ubyte:this (FullOpts)
          47 (20.89 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.SocketPal:SetMulticastOption(System.Net.Sockets.SafeSocketHandle,int,System.Net.Sockets.MulticastOption):int (FullOpts)
          46 (8.75 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.Socket:ReceiveFromAsync(System.Memory`1[ubyte],int,System.Net.EndPoint,System.Threading.CancellationToken):System.Threading.Tasks.ValueTask`1[System.Net.Sockets.SocketReceiveFromResult]:this (FullOpts)
          46 (25.27 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.TcpListener:Create(int):System.Net.Sockets.TcpListener (FullOpts)
          46 (10.90 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.UdpClient:DropMulticastGroup(System.Net.IPAddress):this (FullOpts)
          46 (10.90 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.UdpClient:JoinMulticastGroup(System.Net.IPAddress):this (FullOpts)
          45 (214.29 % of base) : System.Net.Primitives.dasm - System.Net.IPNetwork:get_BaseAddress():System.Net.IPAddress:this (FullOpts)
          43 (2.99 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.Socket:ReceiveFrom(System.Span`1[ubyte],int,byref):int:this (FullOpts)
          20 (3.88 % of base) : System.Net.Primitives.dasm - System.Net.IPAddress:.cctor() (FullOpts)
          20 (7.78 % of base) : System.Net.Primitives.dasm - System.Net.IPAddress:.ctor(System.ReadOnlySpan`1[ubyte],long):this (FullOpts)
          20 (10.75 % of base) : System.Net.Primitives.dasm - System.Net.IPAddress:.ctor(System.ReadOnlySpan`1[ubyte]):this (FullOpts)

Top method improvements (bytes):
         -14 (-16.09 % of base) : System.Net.Primitives.dasm - System.Net.IPAddress:ReadUInt16NumbersFromBytes(System.ReadOnlySpan`1[ubyte]):ushort[] (FullOpts)
         -12 (-32.43 % of base) : System.Private.CoreLib.dasm - System.Numerics.Vector4:.ctor(System.ReadOnlySpan`1[float]):this (FullOpts)
         -12 (-32.43 % of base) : System.Private.CoreLib.dasm - System.Numerics.Vector4:Create(System.ReadOnlySpan`1[float]):System.Numerics.Vector4 (FullOpts)
         -12 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector128`1[double]:System.Runtime.Intrinsics.ISimdVector<System.Runtime.Intrinsics.Vector128<T>,T>.Create(System.ReadOnlySpan`1[double]):System.Runtime.Intrinsics.Vector128`1[double] (FullOpts)
         -12 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector128`1[int]:System.Runtime.Intrinsics.ISimdVector<System.Runtime.Intrinsics.Vector128<T>,T>.Create(System.ReadOnlySpan`1[int]):System.Runtime.Intrinsics.Vector128`1[int] (FullOpts)
         -12 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector128`1[long]:System.Runtime.Intrinsics.ISimdVector<System.Runtime.Intrinsics.Vector128<T>,T>.Create(System.ReadOnlySpan`1[long]):System.Runtime.Intrinsics.Vector128`1[long] (FullOpts)
         -12 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector128`1[short]:System.Runtime.Intrinsics.ISimdVector<System.Runtime.Intrinsics.Vector128<T>,T>.Create(System.ReadOnlySpan`1[short]):System.Runtime.Intrinsics.Vector128`1[short] (FullOpts)
         -12 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector128`1[ubyte]:System.Runtime.Intrinsics.ISimdVector<System.Runtime.Intrinsics.Vector128<T>,T>.Create(System.ReadOnlySpan`1[ubyte]):System.Runtime.Intrinsics.Vector128`1[ubyte] (FullOpts)

Top method regressions (percentages):
         116 (232.00 % of base) : System.Net.Primitives.dasm - System.Net.IPNetwork:Equals(System.Net.IPNetwork):ubyte:this (FullOpts)
          45 (214.29 % of base) : System.Net.Primitives.dasm - System.Net.IPNetwork:get_BaseAddress():System.Net.IPAddress:this (FullOpts)
         106 (179.66 % of base) : System.Net.Primitives.dasm - System.Net.IPNetwork:op_Equality(System.Net.IPNetwork,System.Net.IPNetwork):ubyte (FullOpts)
          59 (147.50 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.UdpClient:IsBroadcast(System.Net.IPAddress):ubyte (FullOpts)
          57 (123.91 % of base) : System.Net.Primitives.dasm - System.Net.IPNetwork:GetHashCode():int:this (FullOpts)
          91 (108.33 % of base) : System.Net.Primitives.dasm - System.Net.IPNetwork:op_Inequality(System.Net.IPNetwork,System.Net.IPNetwork):ubyte (FullOpts)
          94 (97.92 % of base) : System.Net.Primitives.dasm - System.Net.IPNetwork:Equals(System.Object):ubyte:this (FullOpts)
          89 (61.38 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.UdpClient:BeginReceive(System.AsyncCallback,System.Object):System.IAsyncResult:this (FullOpts)
          51 (60.71 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.MulticastOption:.ctor(System.Net.IPAddress):this (FullOpts)
          90 (48.91 % of base) : System.Net.Primitives.dasm - System.Net.IPAddress:IsLoopback(System.Net.IPAddress):ubyte (FullOpts)
          83 (48.54 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.Socket:IsWildcardEndPoint(System.Net.EndPoint):ubyte (FullOpts)
          94 (37.90 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.UdpClient:ReceiveAsync(System.Threading.CancellationToken):System.Threading.Tasks.ValueTask`1[System.Net.Sockets.UdpReceiveResult]:this (FullOpts)
         191 (32.21 % of base) : System.Net.Primitives.dasm - System.Net.IPNetwork:Contains(System.Net.IPAddress):ubyte:this (FullOpts)
          48 (30.77 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.Socket:.cctor() (FullOpts)
          99 (30.65 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.UdpClient:EndReceive(System.IAsyncResult,byref):ubyte[]:this (FullOpts)
          92 (27.71 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.UdpClient:Receive(byref):ubyte[]:this (FullOpts)
          46 (25.27 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.TcpListener:Create(int):System.Net.Sockets.TcpListener (FullOpts)
          92 (23.59 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.UdpClient:ReceiveAsync():System.Threading.Tasks.Task`1[System.Net.Sockets.UdpReceiveResult]:this (FullOpts)
          51 (21.52 % of base) : System.Net.Primitives.dasm - System.Net.IPNetwork:TryFormat(System.Span`1[ushort],byref):ubyte:this (FullOpts)
          47 (20.89 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.SocketPal:SetMulticastOption(System.Net.Sockets.SafeSocketHandle,int,System.Net.Sockets.MulticastOption):int (FullOpts)
          51 (20.73 % of base) : System.Net.Primitives.dasm - System.Net.IPNetwork:TryFormat(System.Span`1[ubyte],byref):ubyte:this (FullOpts)
          51 (20.56 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.TcpListener:.ctor(int):this (FullOpts)
          97 (20.00 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.UdpClient:.ctor(int,int):this (FullOpts)
          47 (16.79 % of base) : System.Net.Primitives.dasm - System.Net.IPNetwork:ToString():System.String:this (FullOpts)
          54 (16.62 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.Socket:SetReceivingPacketInformation():this (FullOpts)
          46 (10.90 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.UdpClient:DropMulticastGroup(System.Net.IPAddress):this (FullOpts)
          46 (10.90 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.UdpClient:JoinMulticastGroup(System.Net.IPAddress):this (FullOpts)
          20 (10.75 % of base) : System.Net.Primitives.dasm - System.Net.IPAddress:.ctor(System.ReadOnlySpan`1[ubyte]):this (FullOpts)
          46 (8.75 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.Socket:ReceiveFromAsync(System.Memory`1[ubyte],int,System.Net.EndPoint,System.Threading.CancellationToken):System.Threading.Tasks.ValueTask`1[System.Net.Sockets.SocketReceiveFromResult]:this (FullOpts)
          20 (7.78 % of base) : System.Net.Primitives.dasm - System.Net.IPAddress:.ctor(System.ReadOnlySpan`1[ubyte],long):this (FullOpts)
          47 (4.93 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.Socket:ReceiveFromAsync(System.Net.Sockets.SocketAsyncEventArgs,System.Threading.CancellationToken):ubyte:this (FullOpts)
          20 (3.88 % of base) : System.Net.Primitives.dasm - System.Net.IPAddress:.cctor() (FullOpts)
          43 (2.99 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.Socket:ReceiveFrom(System.Span`1[ubyte],int,byref):int:this (FullOpts)
          47 (2.67 % of base) : System.Net.Sockets.dasm - System.Net.Sockets.Socket:ReceiveFrom(ubyte[],int,int,int,byref):int:this (FullOpts)

Top method improvements (percentages):
         -12 (-32.43 % of base) : System.Private.CoreLib.dasm - System.Numerics.Vector4:.ctor(System.ReadOnlySpan`1[float]):this (FullOpts)
         -12 (-32.43 % of base) : System.Private.CoreLib.dasm - System.Numerics.Vector4:Create(System.ReadOnlySpan`1[float]):System.Numerics.Vector4 (FullOpts)
         -12 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector128`1[double]:System.Runtime.Intrinsics.ISimdVector<System.Runtime.Intrinsics.Vector128<T>,T>.Create(System.ReadOnlySpan`1[double]):System.Runtime.Intrinsics.Vector128`1[double] (FullOpts)
         -12 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector128`1[int]:System.Runtime.Intrinsics.ISimdVector<System.Runtime.Intrinsics.Vector128<T>,T>.Create(System.ReadOnlySpan`1[int]):System.Runtime.Intrinsics.Vector128`1[int] (FullOpts)
         -12 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector128`1[long]:System.Runtime.Intrinsics.ISimdVector<System.Runtime.Intrinsics.Vector128<T>,T>.Create(System.ReadOnlySpan`1[long]):System.Runtime.Intrinsics.Vector128`1[long] (FullOpts)
         -12 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector128`1[short]:System.Runtime.Intrinsics.ISimdVector<System.Runtime.Intrinsics.Vector128<T>,T>.Create(System.ReadOnlySpan`1[short]):System.Runtime.Intrinsics.Vector128`1[short] (FullOpts)
         -12 (-30.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.Intrinsics.Vector128`1[ubyte]:System.Runtime.Intrinsics.ISimdVector<System.Runtime.Intrinsics.Vector128<T>,T>.Create(System.ReadOnlySpan`1[ubyte]):System.Runtime.Intrinsics.Vector128`1[ubyte] (FullOpts)
         -14 (-16.09 % of base) : System.Net.Primitives.dasm - System.Net.IPAddress:ReadUInt16NumbersFromBytes(System.ReadOnlySpan`1[ubyte]):ushort[] (FullOpts)

42 total methods with Code Size differences (8 improved, 34 regressed), 248147 unchanged.

--------------------------------------------------------------------------------

Artifacts:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions