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 -97%] System.Collections.IterateForEach<String>.ImmutableArray #2285

Open
performanceautofiler bot opened this issue Oct 13, 2020 · 1 comment
Open

Comments

@performanceautofiler
Copy link

performanceautofiler bot commented Oct 13, 2020

Run Information

Architecture x64
OS ubuntu 18.04
Changes diff

Regressions in System.Collections.IterateForEach

Benchmark Baseline Test Test/Base Modality Baseline Outlier Baseline ETL Comapre ETL
ImmutableArray 229.85 ns 452.97 ns 1.97 True

graph
Historical Data in Reporting System

Repro

git clone https://github.com/dotnet/performance.git
python3 .\performance\scripts\benchmarks_ci.py -f netcoreapp5.0 --filter 'System.Collections.IterateForEach<String>*'

Histogram

System.Collections.IterateForEach.ImmutableArray(Size: 512)

[191.001 ; 241.559) | @@@@@@@@@@@@@@@@@@@@@@
[241.559 ; 292.117) | 
[292.117 ; 342.675) | 
[342.675 ; 393.232) | 
[393.232 ; 428.361) | 
[428.361 ; 480.151) | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Docs

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

@kunalspathak
Copy link
Collaborator

I am not sure if this is alignment related issue or the loop alignment would help here. The loop in the benchmark fits in 2 32B chunks as seen below and we don't need to add extra alignment here.

; =========================== 32B boundary ===========================
 00007ffb`9af2e863        EB3E                 jmp      SHORT G_M56622_IG07
; ~~~~~~~~~~~~~~~~~~~~~~ Skipping because (currentOffset < extraBytesNotInLoop) ~~~~~~~~~~~~~~~~~~~~~~
 00007ffb`9af2e865                             align
 00007ffb`9af2e865                             align
 00007ffb`9af2e865                             align
                                                ;; bbWeight=1    PerfScore 4.75
G_M56622_IG06:              ;; offset=0065H
 00007ffb`9af2e865        488B442428           mov      rax, gword ptr [rsp+28H]
 00007ffb`9af2e86a        8B4008               mov      eax, dword ptr [rax+8]
 00007ffb`9af2e86d        39442430             cmp      dword ptr [rsp+30H], eax
 00007ffb`9af2e871        732F                 jae      SHORT G_M56622_IG10
 00007ffb`9af2e873        488B442428           mov      rax, gword ptr [rsp+28H]
 00007ffb`9af2e878        8B542430             mov      edx, dword ptr [rsp+30H]
 00007ffb`9af2e87c        4863D2               movsxd   rdx, edx
 00007ffb`9af2e87f        488B7CD010           mov      rdi, gword ptr [rax+8*rdx+16]
; =========================== 32B boundary ===========================
                                                ;; bbWeight=2    PerfScore 18.50
G_M56622_IG07:              ;; offset=0084H
 00007ffb`9af2e884        8B442430             mov      eax, dword ptr [rsp+30H]
 00007ffb`9af2e888        FFC0                 inc      eax
 00007ffb`9af2e88a        89442430             mov      dword ptr [rsp+30H], eax
 00007ffb`9af2e88e        488B542428           mov      rdx, gword ptr [rsp+28H]
 00007ffb`9af2e893        394208               cmp      dword ptr [rdx+8], eax
 00007ffb`9af2e896        7FCD                 jg       SHORT G_M56622_IG06
                                                ;; bbWeight=8    PerfScore 50.00

CC: @adamsitnik , @AndyAyersMS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants