Skip to content

[X64] [MichalPetryka] Simplify and optimize Math(F).Round #238

@MihuBot

Description

@MihuBot

Build completed in 2 hours 15 minutes.
dotnet/runtime#98186

CoreLib diffs

Found 2 files with textual diffs.

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 6824581
Total bytes of diff: 6827595
Total bytes of delta: 3014 (0.04 % of base)
Total relative delta: 74.85
    diff is a regression.
    relative diff is a regression.


Total byte diff includes 1355 bytes from reconciling methods
	Base had    1 unique methods,        3 unique bytes
	Diff had   10 unique methods,     1358 unique bytes

Top file regressions (bytes):
        3014 : System.Private.CoreLib.dasm (0.04 % of base)

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

Top method regressions (bytes):
         249 (1,556.25 % of base) : System.Private.CoreLib.dasm - System.Double:Round(double,int,int):double (FullOpts)
         249 (1,556.25 % of base) : System.Private.CoreLib.dasm - System.Single:Round(float,int,int):float (FullOpts)
         243 (1,104.55 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.NFloat:Round(System.Runtime.InteropServices.NFloat,int,int):System.Runtime.InteropServices.NFloat (FullOpts)
         230 (605.26 % of base) : System.Private.CoreLib.dasm - System.Double:Round(double,int):double (FullOpts) (2 methods)
         230 (605.26 % of base) : System.Private.CoreLib.dasm - System.Math:Round(double,int):double (FullOpts) (2 methods)
         230 (605.26 % of base) : System.Private.CoreLib.dasm - System.MathF:Round(float,int):float (FullOpts) (2 methods)
         230 (605.26 % of base) : System.Private.CoreLib.dasm - System.Single:Round(float,int):float (FullOpts) (2 methods)
         224 (355.56 % of base) : System.Private.CoreLib.dasm - System.Half:Round(System.Half,int,int):System.Half (FullOpts)
         218 (436.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.NFloat:Round(System.Runtime.InteropServices.NFloat,int):System.Runtime.InteropServices.NFloat (FullOpts) (2 methods)
         200 (166.67 % of base) : System.Private.CoreLib.dasm - System.Half:Round(System.Half,int):System.Half (FullOpts) (2 methods)
         165 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[double](double,System.String) (FullOpts) (0 base, 1 diff methods)
         156 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[System.Numerics.Vector`1[float]](System.Numerics.Vector`1[float],System.String) (FullOpts) (0 base, 1 diff methods)
         154 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[System.Nullable`1[int]](System.Nullable`1[int],System.String) (FullOpts) (0 base, 1 diff methods)
         150 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[short](short,System.String) (FullOpts) (0 base, 1 diff methods)
         149 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[int](int,System.String) (FullOpts) (0 base, 1 diff methods)
         149 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[long](long,System.String) (FullOpts) (0 base, 1 diff methods)
         149 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[ubyte](ubyte,System.String) (FullOpts) (0 base, 1 diff methods)
         142 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[System.__Canon](System.__Canon,System.String) (FullOpts) (0 base, 1 diff methods)
          72 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentOutOfRange_RoundingDigits_MathF(System.String) (FullOpts) (0 base, 1 diff methods)
          72 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentOutOfRange_RoundingDigits(System.String) (FullOpts) (0 base, 1 diff methods)

Top method improvements (bytes):
        -322 (-55.61 % of base) : System.Private.CoreLib.dasm - System.Math:Round(double,int,int):double (FullOpts)
        -322 (-55.61 % of base) : System.Private.CoreLib.dasm - System.MathF:Round(float,int,int):float (FullOpts)
          -3 (-100.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.CompilerServices.RuntimeHelpers:IsKnownConstant(int):ubyte (FullOpts) (1 base, 0 diff methods)

Top method regressions (percentages):
         165 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[double](double,System.String) (FullOpts) (0 base, 1 diff methods)
         149 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[int](int,System.String) (FullOpts) (0 base, 1 diff methods)
         149 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[long](long,System.String) (FullOpts) (0 base, 1 diff methods)
         150 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[short](short,System.String) (FullOpts) (0 base, 1 diff methods)
         142 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[System.__Canon](System.__Canon,System.String) (FullOpts) (0 base, 1 diff methods)
         154 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[System.Nullable`1[int]](System.Nullable`1[int],System.String) (FullOpts) (0 base, 1 diff methods)
         156 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[System.Numerics.Vector`1[float]](System.Numerics.Vector`1[float],System.String) (FullOpts) (0 base, 1 diff methods)
         149 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[ubyte](ubyte,System.String) (FullOpts) (0 base, 1 diff methods)
          72 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentOutOfRange_RoundingDigits_MathF(System.String) (FullOpts) (0 base, 1 diff methods)
          72 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentOutOfRange_RoundingDigits(System.String) (FullOpts) (0 base, 1 diff methods)
         249 (1,556.25 % of base) : System.Private.CoreLib.dasm - System.Double:Round(double,int,int):double (FullOpts)
         249 (1,556.25 % of base) : System.Private.CoreLib.dasm - System.Single:Round(float,int,int):float (FullOpts)
         243 (1,104.55 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.NFloat:Round(System.Runtime.InteropServices.NFloat,int,int):System.Runtime.InteropServices.NFloat (FullOpts)
         230 (605.26 % of base) : System.Private.CoreLib.dasm - System.Double:Round(double,int):double (FullOpts) (2 methods)
         230 (605.26 % of base) : System.Private.CoreLib.dasm - System.Math:Round(double,int):double (FullOpts) (2 methods)
         230 (605.26 % of base) : System.Private.CoreLib.dasm - System.MathF:Round(float,int):float (FullOpts) (2 methods)
         230 (605.26 % of base) : System.Private.CoreLib.dasm - System.Single:Round(float,int):float (FullOpts) (2 methods)
         218 (436.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.NFloat:Round(System.Runtime.InteropServices.NFloat,int):System.Runtime.InteropServices.NFloat (FullOpts) (2 methods)
         224 (355.56 % of base) : System.Private.CoreLib.dasm - System.Half:Round(System.Half,int,int):System.Half (FullOpts)
         200 (166.67 % of base) : System.Private.CoreLib.dasm - System.Half:Round(System.Half,int):System.Half (FullOpts) (2 methods)

Top method improvements (percentages):
          -3 (-100.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.CompilerServices.RuntimeHelpers:IsKnownConstant(int):ubyte (FullOpts) (1 base, 0 diff methods)
        -322 (-55.61 % of base) : System.Private.CoreLib.dasm - System.Math:Round(double,int,int):double (FullOpts)
        -322 (-55.61 % of base) : System.Private.CoreLib.dasm - System.MathF:Round(float,int,int):float (FullOpts)

23 total methods with Code Size differences (3 improved, 20 regressed), 55774 unchanged.

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

Frameworks diffs

Diffs
Found 260 files with textual diffs.

Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 38296082
Total bytes of diff: 38299382
Total bytes of delta: 3300 (0.01 % of base)
Total relative delta: 86.66
    diff is a regression.
    relative diff is a regression.


Total byte diff includes 1355 bytes from reconciling methods
	Base had    1 unique methods,        3 unique bytes
	Diff had   10 unique methods,     1358 unique bytes

Top file regressions (bytes):
        3014 : System.Private.CoreLib.dasm (0.04 % of base)
         247 : System.Numerics.Tensors.dasm (0.20 % of base)
          39 : System.Runtime.Numerics.dasm (0.03 % of base)

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

Top method regressions (bytes):
         249 (1,556.25 % of base) : System.Private.CoreLib.dasm - System.Double:Round(double,int,int):double (FullOpts)
         249 (1,556.25 % of base) : System.Private.CoreLib.dasm - System.Single:Round(float,int,int):float (FullOpts)
         247 (1,176.19 % of base) : System.Numerics.Tensors.dasm - System.Numerics.Tensors.TensorPrimitives+RoundFallbackOperator`1[double]:Invoke(double):double:this (FullOpts)
         243 (1,104.55 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.NFloat:Round(System.Runtime.InteropServices.NFloat,int,int):System.Runtime.InteropServices.NFloat (FullOpts)
         230 (605.26 % of base) : System.Private.CoreLib.dasm - System.Double:Round(double,int):double (FullOpts) (2 methods)
         230 (605.26 % of base) : System.Private.CoreLib.dasm - System.Math:Round(double,int):double (FullOpts) (2 methods)
         230 (605.26 % of base) : System.Private.CoreLib.dasm - System.MathF:Round(float,int):float (FullOpts) (2 methods)
         230 (605.26 % of base) : System.Private.CoreLib.dasm - System.Single:Round(float,int):float (FullOpts) (2 methods)
         224 (355.56 % of base) : System.Private.CoreLib.dasm - System.Half:Round(System.Half,int,int):System.Half (FullOpts)
         218 (436.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.NFloat:Round(System.Runtime.InteropServices.NFloat,int):System.Runtime.InteropServices.NFloat (FullOpts) (2 methods)
         200 (166.67 % of base) : System.Private.CoreLib.dasm - System.Half:Round(System.Half,int):System.Half (FullOpts) (2 methods)
         165 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[double](double,System.String) (FullOpts) (0 base, 1 diff methods)
         156 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[System.Numerics.Vector`1[float]](System.Numerics.Vector`1[float],System.String) (FullOpts) (0 base, 1 diff methods)
         154 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[System.Nullable`1[int]](System.Nullable`1[int],System.String) (FullOpts) (0 base, 1 diff methods)
         150 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[short](short,System.String) (FullOpts) (0 base, 1 diff methods)
         149 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[int](int,System.String) (FullOpts) (0 base, 1 diff methods)
         149 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[long](long,System.String) (FullOpts) (0 base, 1 diff methods)
         149 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[ubyte](ubyte,System.String) (FullOpts) (0 base, 1 diff methods)
         142 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[System.__Canon](System.__Canon,System.String) (FullOpts) (0 base, 1 diff methods)
          72 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentOutOfRange_RoundingDigits_MathF(System.String) (FullOpts) (0 base, 1 diff methods)
          72 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentOutOfRange_RoundingDigits(System.String) (FullOpts) (0 base, 1 diff methods)
          39 (4.86 % of base) : System.Runtime.Numerics.dasm - System.Numerics.BigInteger:get_DebuggerDisplay():System.String:this (FullOpts)

Top method improvements (bytes):
        -322 (-55.61 % of base) : System.Private.CoreLib.dasm - System.Math:Round(double,int,int):double (FullOpts)
        -322 (-55.61 % of base) : System.Private.CoreLib.dasm - System.MathF:Round(float,int,int):float (FullOpts)
          -3 (-100.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.CompilerServices.RuntimeHelpers:IsKnownConstant(int):ubyte (FullOpts) (1 base, 0 diff methods)

Top method regressions (percentages):
         165 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[double](double,System.String) (FullOpts) (0 base, 1 diff methods)
         149 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[int](int,System.String) (FullOpts) (0 base, 1 diff methods)
         149 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[long](long,System.String) (FullOpts) (0 base, 1 diff methods)
         150 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[short](short,System.String) (FullOpts) (0 base, 1 diff methods)
         142 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[System.__Canon](System.__Canon,System.String) (FullOpts) (0 base, 1 diff methods)
         154 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[System.Nullable`1[int]](System.Nullable`1[int],System.String) (FullOpts) (0 base, 1 diff methods)
         156 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[System.Numerics.Vector`1[float]](System.Numerics.Vector`1[float],System.String) (FullOpts) (0 base, 1 diff methods)
         149 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentException_InvalidEnumValue[ubyte](ubyte,System.String) (FullOpts) (0 base, 1 diff methods)
          72 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentOutOfRange_RoundingDigits_MathF(System.String) (FullOpts) (0 base, 1 diff methods)
          72 (Infinity of base) : System.Private.CoreLib.dasm - System.ThrowHelper:ThrowArgumentOutOfRange_RoundingDigits(System.String) (FullOpts) (0 base, 1 diff methods)
         249 (1,556.25 % of base) : System.Private.CoreLib.dasm - System.Double:Round(double,int,int):double (FullOpts)
         249 (1,556.25 % of base) : System.Private.CoreLib.dasm - System.Single:Round(float,int,int):float (FullOpts)
         247 (1,176.19 % of base) : System.Numerics.Tensors.dasm - System.Numerics.Tensors.TensorPrimitives+RoundFallbackOperator`1[double]:Invoke(double):double:this (FullOpts)
         243 (1,104.55 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.NFloat:Round(System.Runtime.InteropServices.NFloat,int,int):System.Runtime.InteropServices.NFloat (FullOpts)
         230 (605.26 % of base) : System.Private.CoreLib.dasm - System.Double:Round(double,int):double (FullOpts) (2 methods)
         230 (605.26 % of base) : System.Private.CoreLib.dasm - System.Math:Round(double,int):double (FullOpts) (2 methods)
         230 (605.26 % of base) : System.Private.CoreLib.dasm - System.MathF:Round(float,int):float (FullOpts) (2 methods)
         230 (605.26 % of base) : System.Private.CoreLib.dasm - System.Single:Round(float,int):float (FullOpts) (2 methods)
         218 (436.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.InteropServices.NFloat:Round(System.Runtime.InteropServices.NFloat,int):System.Runtime.InteropServices.NFloat (FullOpts) (2 methods)
         224 (355.56 % of base) : System.Private.CoreLib.dasm - System.Half:Round(System.Half,int,int):System.Half (FullOpts)
         200 (166.67 % of base) : System.Private.CoreLib.dasm - System.Half:Round(System.Half,int):System.Half (FullOpts) (2 methods)
          39 (4.86 % of base) : System.Runtime.Numerics.dasm - System.Numerics.BigInteger:get_DebuggerDisplay():System.String:this (FullOpts)

Top method improvements (percentages):
          -3 (-100.00 % of base) : System.Private.CoreLib.dasm - System.Runtime.CompilerServices.RuntimeHelpers:IsKnownConstant(int):ubyte (FullOpts) (1 base, 0 diff methods)
        -322 (-55.61 % of base) : System.Private.CoreLib.dasm - System.Math:Round(double,int,int):double (FullOpts)
        -322 (-55.61 % of base) : System.Private.CoreLib.dasm - System.MathF:Round(float,int,int):float (FullOpts)

25 total methods with Code Size differences (3 improved, 22 regressed), 238546 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