Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Perf -50%] System.Numerics.Tests.Perf_Vector2.LengthSquaredBenchmark #37425

Closed
DrewScoggins opened this issue Jun 4, 2020 · 6 comments
Closed
Assignees
Labels
arch-x64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI os-windows tenet-performance Performance related issue tenet-performance-benchmarks Issue from performance benchmark
Milestone

Comments

@DrewScoggins
Copy link
Member

DrewScoggins commented Jun 4, 2020

Run Information

Architecture x64
OS Windows 10.0.18362
Changes diff

Regressions in System.Numerics.Tests.Perf_Vector2

Benchmark Baseline Test Test/Base Modality Baseline Outlier
LengthSquaredBenchmark 0.34 ns 0.51 ns 1.50 False

Historical Data in Reporting System

Repro

git clone https://github.com/dotnet/performance.git
py .\performance\scripts\benchmarks_ci.py -f netcoreapp5.0 --filter 'System.Numerics.Tests.Perf_Vector2*';

Histogram

LengthSquaredBenchmark

[0.305 ; 0.369) | @@@@@@@@@@@@@@@
[0.369 ; 0.434) | @
[0.434 ; 0.510) | @@@@@@@@@@@@@@@@@@@@@@@
[0.510 ; 0.539) | 
[0.539 ; 0.604) | @@@@@@@@@@@@@@@

Docs

Profiling workflow for dotnet/runtime repository
Benchmarking workflow for dotnet/runtime repository

category:cq
theme:vector-codegen
skill-level:intermediate
cost:medium

@DrewScoggins DrewScoggins added the tenet-performance Performance related issue label Jun 4, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.Numerics untriaged New issue has not been triaged by the area owner labels Jun 4, 2020
@ghost
Copy link

ghost commented Jun 4, 2020

Tagging subscribers to this area: @tannergooding
Notify danmosemsft if you want to be subscribed.

@tannergooding
Copy link
Member

tannergooding commented Jun 4, 2020

The regression is due to Vector2.DotProduct not being a SimdAsHWIntrinsic yet and so there is some register shuffling when transitioning from the legacy GT_SIMD to the newer GT_HWINTRINSIC as the RMW and VEX support between them isn't the same.

@AndyAyersMS
Copy link
Member

@tannergooding is this covered by the PR above?

Marking this as codegen.

@AndyAyersMS AndyAyersMS added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI and removed area-System.Numerics untriaged New issue has not been triaged by the area owner labels Jun 22, 2020
@AndyAyersMS AndyAyersMS added this to the 5.0.0 milestone Jun 22, 2020
@tannergooding
Copy link
Member

Yes. This was due to some, but not all, of the System.Numerics intrinsics being transitioned to use HWIntrinsic internally.

The GT_HWINTRINSIC nodes are VEX aware while the GT_SIMD nodes are not, which caused a few additional moves to be inserted. The above PR transitions Dot and the other big functions to also use HWIntrinsics which allows the additional moves to be elided.

@BruceForstall
Copy link
Member

@tannergooding Was this fixed by #37882? Or does the issue need to remain open?

@tannergooding
Copy link
Member

@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-x64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI os-windows tenet-performance Performance related issue tenet-performance-benchmarks Issue from performance benchmark
Projects
None yet
Development

No branches or pull requests

5 participants