runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Math.Atan2(float, float) 20% slower on macOS

Open adamsitnik opened this issue 4 years ago • 3 comments
trafficstars

Math.Atan2(float, float) has become 20% slower compared to 5.0. This regression is specific to macOS, other configs are not affected.

Repro

git clone https://github.com/dotnet/performance.git
python3 ./performance/scripts/benchmarks_ci.py -f net5.0 net6.0 --filter System.MathBenchmarks.Single.Atan2

Full data from the most recent comparison

Result Base Diff Ratio Alloc Delta Modality Operating System Bit Processor Name Base V Diff V
Same 59754.62 61630.79 0.97 +0 Windows 10.0.19042 X64 AMD Ryzen Threadripper 2990WX 5.0.421.11614 6.0.21.16201
Same 50559.30 50670.28 1.00 +0 Windows 10.0.21337 X64 AMD Ryzen 9 3900X 5.0.421.11614 6.0.21.16701
Same 52376.47 53374.19 0.98 +0 Windows 10.0.21337 X64 AMD Ryzen Threadripper 3990X 5.0.421.11614 6.0.21.16701
Same 57494.28 57049.94 1.01 +0 Windows 10.0.18363.1440 X64 Intel Xeon CPU E5-1650 v4 3.60GHz 5.0.421.11614 6.0.21.16201
Same 354537.08 353258.81 1.00 +0 Windows 10.0.21337 X64 Intel Core i5-4300U CPU 1.90GHz (Haswell) 5.0.421.11614 6.0.21.16701
Same 60440.94 58325.99 1.04 +0 Windows 10.0.19042 X64 Intel Core i7-6700 CPU 3.40GHz (Skylake) 5.0.421.11614 6.0.21.16201
Same 63741.10 57937.25 1.10 +0 Windows 10.0.19042 X64 Intel Core i7-7700 CPU 3.60GHz (Kaby Lake) 5.0.421.11614 6.0.21.16201
Same 70574.55 69330.90 1.02 +0 Windows 10.0.19042 X64 Intel Core i7-8650U CPU 1.90GHz (Kaby Lake R) 5.0.421.11614 6.0.21.16408
Same 51427.55 50918.57 1.01 +0 Windows 10.0.19042 X64 Intel Core i7-8700 CPU 3.20GHz (Coffee Lake) 5.0.421.11614 6.0.21.16201
Same 51693.97 52342.48 0.99 +0 Windows 10.0.19042 X64 Intel Core i7-8700 CPU 3.20GHz (Coffee Lake) 5.0.421.11614 6.0.21.16408
Same 323621.43 325226.02 1.00 +0 Windows 10.0.19042 X64 Intel Atom x7-Z8700 CPU 1.60GHz 5.0.421.11614 6.0.21.16309
Same 69054.19 70118.82 0.98 +0 ubuntu 18.04 X64 Intel Xeon CPU E5-1650 v4 3.60GHz 5.0.421.11614 6.0.21.16309
Same 54402.62 56148.72 0.97 +0 alpine 3.11 X64 Intel Core i7-7700 CPU 3.60GHz (Kaby Lake) 5.0.421.11614 6.0.21.16601
Same 138361.09 138052.63 1.00 +0 ubuntu 16.04 Arm64 Unknown processor 5.0.421.11614 6.0.21.17806
Same 138435.05 138027.53 1.00 +0 ubuntu 16.04 Arm64 Unknown processor 5.0.421.11614 6.0.21.17806
Same 83156.15 85778.62 0.97 +0 Windows 10.0.19042 Arm64 Microsoft SQ1 3.0 GHz 5.0.421.11614 6.0.21.16309
Same 84458.32 84261.45 1.00 +0 Windows 10.0.19042 Arm64 Microsoft SQ1 3.0 GHz 5.0.421.11614 6.0.21.16201
Same 352665.69 334173.01 1.06 +0 Windows 10.0.18363.1440 X86 Intel Xeon CPU E5-1650 v4 3.60GHz 5.0.421.11614 6.0.21.16701
Same 95863.96 92262.87 1.04 +0 Windows 10.0.19042.867 Arm Microsoft SQ1 3.0 GHz 5.0.421.11614 6.0.21.17905
Slower 25241.56 28955.81 0.87 +0 macOS 11.2 X64 Intel Core i5-4278U CPU 2.60GHz (Haswell) 5.0.421.11614 6.0.21.16408
Slower 24702.31 28946.34 0.85 +0 macOS 11.2.3 X64 Intel Core i5-4278U CPU 2.60GHz (Haswell) 5.0.421.11614 6.0.21.16601
Slower 20871.07 26153.08 0.80 +0 macOS 11.2.2 X64 Intel Core i7-4870HQ CPU 2.50GHz (Haswell) 5.0.421.11614 6.0.21.16601
Slower 21634.97 26322.87 0.82 +0 macOS Mojave 10.14.5 X64 Intel Core i7-5557U CPU 3.10GHz (Broadwell) 5.0.421.11614 6.0.21.16309

adamsitnik avatar Apr 08 '21 10:04 adamsitnik

The same is true for System.MathBenchmarks.Double.ILogB and System.MathBenchmarks.Single.ILogB

Result Base Diff Ratio Alloc Delta Modality Operating System Bit Processor Name Base V Diff V
Same 23985.50 23816.35 1.01 +0 Windows 10.0.19042 X64 AMD Ryzen Threadripper 2990WX 5.0.421.11614 6.0.21.16201
Same 23344.49 22061.87 1.06 +0 Windows 10.0.21337 X64 AMD Ryzen 9 3900X 5.0.421.11614 6.0.21.16701
Same 24188.44 23280.07 1.04 +0 Windows 10.0.21337 X64 AMD Ryzen Threadripper 3990X 5.0.421.11614 6.0.21.16701
Same 25194.98 25259.66 1.00 +0 Windows 10.0.18363.1440 X64 Intel Xeon CPU E5-1650 v4 3.60GHz 5.0.421.11614 6.0.21.16201
Slower 36773.68 127315.15 0.29 +0 Windows 10.0.21337 X64 Intel Core i5-4300U CPU 1.90GHz (Haswell) 5.0.421.11614 6.0.21.16701
Same 22436.96 22270.67 1.01 +0 Windows 10.0.19042 X64 Intel Core i7-6700 CPU 3.40GHz (Skylake) 5.0.421.11614 6.0.21.16201
Same 22754.40 22775.53 1.00 +0 Windows 10.0.19042 X64 Intel Core i7-7700 CPU 3.60GHz (Kaby Lake) 5.0.421.11614 6.0.21.16201
Same 28465.67 24993.07 1.14 +0 Windows 10.0.19042 X64 Intel Core i7-8650U CPU 1.90GHz (Kaby Lake R) 5.0.421.11614 6.0.21.16408
Same 19672.70 19523.70 1.01 +0 Windows 10.0.19042 X64 Intel Core i7-8700 CPU 3.20GHz (Coffee Lake) 5.0.421.11614 6.0.21.16201
Same 21300.83 19252.72 1.11 +0 Windows 10.0.19042 X64 Intel Core i7-8700 CPU 3.20GHz (Coffee Lake) 5.0.421.11614 6.0.21.16408
Same 85033.87 79636.83 1.07 +0 Windows 10.0.19042 X64 Intel Atom x7-Z8700 CPU 1.60GHz 5.0.421.11614 6.0.21.16309
Same 38057.01 34240.59 1.11 +0 ubuntu 18.04 X64 Intel Xeon CPU E5-1650 v4 3.60GHz 5.0.421.11614 6.0.21.16309
Same 17000.50 16933.04 1.00 +0 alpine 3.11 X64 Intel Core i7-7700 CPU 3.60GHz (Kaby Lake) 5.0.421.11614 6.0.21.16601
Same 55851.19 55849.98 1.00 +0 ubuntu 16.04 Arm64 Unknown processor 5.0.421.11614 6.0.21.17806
Same 55849.94 55850.14 1.00 +0 ubuntu 16.04 Arm64 Unknown processor 5.0.421.11614 6.0.21.17806
Same 39065.69 39115.88 1.00 +0 Windows 10.0.19042 Arm64 Microsoft SQ1 3.0 GHz 5.0.421.11614 6.0.21.16309
Same 39016.62 39083.86 1.00 +0 Windows 10.0.19042 Arm64 Microsoft SQ1 3.0 GHz 5.0.421.11614 6.0.21.16201
Faster 49097.31 43165.08 1.14 +0 bimodal Windows 10.0.18363.1440 X86 Intel Xeon CPU E5-1650 v4 3.60GHz 5.0.421.11614 6.0.21.16701
Same 44076.75 44503.45 0.99 +0 Windows 10.0.19042.867 Arm Microsoft SQ1 3.0 GHz 5.0.421.11614 6.0.21.17905
Slower 19294.12 22633.67 0.85 +0 macOS 11.2 X64 Intel Core i5-4278U CPU 2.60GHz (Haswell) 5.0.421.11614 6.0.21.16408
Slower 19012.42 22661.16 0.84 +0 macOS 11.2.3 X64 Intel Core i5-4278U CPU 2.60GHz (Haswell) 5.0.421.11614 6.0.21.16601
Slower 16019.12 19022.00 0.84 +0 macOS 11.2.2 X64 Intel Core i7-4870HQ CPU 2.50GHz (Haswell) 5.0.421.11614 6.0.21.16601
Slower 16210.06 18808.96 0.86 +0 macOS Mojave 10.14.5 X64 Intel Core i7-5557U CPU 3.10GHz (Broadwell) 5.0.421.11614 6.0.21.16309

adamsitnik avatar Apr 08 '21 10:04 adamsitnik

@tannergooding macOS perf is not our top priority, but it would be good to know where the regression comes from (I guess that from the ILogB changes, but why is it slower on macOS?).

adamsitnik avatar Apr 08 '21 10:04 adamsitnik

The only changes here that I'm aware of are CSE related. @adamsitnik do you have the disassembly for 5.0 vs 6.0 on hand?

tannergooding avatar Apr 08 '21 14:04 tannergooding