-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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] Changes at 12/9/2020 1:20:52 PM #46153
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
This pull request #42785 is almost certainly the issue. |
@DrewScoggins thanks a thorough report (with disassembly!) -- is it missing a link to see the range of commits though? ie., this link: 53c1619...dcbf6e9 I'm guessing the sha's above are of the points on the graph marked Baseline and Compare (?) but ideally the diff would tightly bracket, and there would be a compare link as we had before? |
Tagging subscribers to this area: @safern, @tannergooding Issue DetailsRun Information
Regressions in System.Drawing.Tests.Perf_Color
Reprogit clone https://github.com/dotnet/performance.git
python3 .\performance\scripts\benchmarks_ci.py -f netcoreapp5.0 --filter 'System.Drawing.Tests.Perf_Color*' . PayloadsHistogramSystem.Drawing.Tests.Perf_Color.GetHue
System.Drawing.Tests.Perf_Color.FromArgb_AlphaColor
DocsProfiling workflow for dotnet/runtime repository Run Information
Regressions in System.Drawing.Tests.Perf_Color
Related Issue on x64 ubuntu[Perf -12%] System.Drawing.Tests.Perf_Color.GetSaturation Related Issue on x64 ubuntu[Perf 23%] System.Drawing.Tests.Perf_Color.GetBrightness
Reprogit clone https://github.com/dotnet/performance.git
py .\performance\scripts\benchmarks_ci.py -f netcoreapp5.0 --filter 'System.Drawing.Tests.Perf_Color*' . PayloadsHistogramSystem.Drawing.Tests.Perf_Color.GetHue
Baseline Jit Disasm; System.Drawing.Tests.Perf_Color.GetHue()
push rdi
push rsi
push rbx
sub rsp,30
vzeroupper
vmovaps [rsp+20],xmm6
vxorps xmm6,xmm6,xmm6
mov rcx,24048077D88
mov rsi,[rcx]
xor edi,edi
mov ebx,[rsi+8]
test ebx,ebx
jle short M00_L01
M00_L00:
movsxd rcx,edi
lea rcx,[rcx+rcx*2]
lea rcx,[rsi+rcx*8+10]
call System.Drawing.Color.GetHue()
vaddss xmm6,xmm0,xmm6
inc edi
cmp ebx,edi
jg short M00_L00
M00_L01:
vmovaps xmm0,xmm6
vmovaps xmm6,[rsp+20]
add rsp,30
pop rbx
pop rsi
pop rdi
ret
; Total bytes of code 87 ; System.Drawing.Color.GetHue()
sub rsp,28
vzeroupper
call System.Drawing.Color.get_Value()
mov edx,eax
and edx,0FF0000
sar edx,10
mov ecx,eax
and ecx,0FF00
sar ecx,8
and eax,0FF
cmp edx,ecx
jne short M01_L00
cmp ecx,eax
jne short M01_L00
vxorps xmm0,xmm0,xmm0
add rsp,28
ret
M01_L00:
mov r8d,edx
mov r9d,ecx
cmp r8d,r9d
jle short M01_L01
mov r8d,ecx
jmp short M01_L02
M01_L01:
mov r8d,edx
M01_L02:
mov r9d,eax
cmp r8d,r9d
jle short M01_L03
mov r9d,eax
jmp short M01_L04
M01_L03:
mov r9d,r8d
M01_L04:
mov r8d,edx
mov r10d,ecx
cmp r8d,r10d
jge short M01_L05
mov r8d,ecx
jmp short M01_L06
M01_L05:
mov r8d,edx
M01_L06:
mov r10d,eax
cmp r8d,r10d
jge short M01_L07
mov r10d,eax
jmp short M01_L08
M01_L07:
mov r10d,r8d
M01_L08:
mov r8d,r10d
sub r8d,r9d
vxorps xmm0,xmm0,xmm0
vcvtsi2ss xmm0,xmm0,r8d
cmp edx,r10d
jne short M01_L09
sub ecx,eax
vxorps xmm1,xmm1,xmm1
vcvtsi2ss xmm1,xmm1,ecx
vdivss xmm0,xmm1,xmm0
jmp short M01_L11
M01_L09:
cmp ecx,r10d
jne short M01_L10
sub eax,edx
vxorps xmm1,xmm1,xmm1
vcvtsi2ss xmm1,xmm1,eax
vdivss xmm0,xmm1,xmm0
vaddss xmm0,xmm0,dword ptr [7FF8AAB6B618]
jmp short M01_L11
M01_L10:
sub edx,ecx
vxorps xmm1,xmm1,xmm1
vcvtsi2ss xmm1,xmm1,edx
vdivss xmm0,xmm1,xmm0
vaddss xmm0,xmm0,dword ptr [7FF8AAB6B61C]
M01_L11:
vmulss xmm0,xmm0,dword ptr [7FF8AAB6B620]
vxorps xmm1,xmm1,xmm1
vucomiss xmm1,xmm0
jbe short M01_L12
vaddss xmm0,xmm0,dword ptr [7FF8AAB6B624]
M01_L12:
add rsp,28
ret
; Total bytes of code 244 Compare Jit Disasm; System.Drawing.Tests.Perf_Color.GetHue()
push rdi
push rsi
push rbx
sub rsp,30
vzeroupper
vmovaps [rsp+20],xmm6
vxorps xmm6,xmm6,xmm6
mov rcx,2392EFC7D88
mov rsi,[rcx]
xor edi,edi
mov ebx,[rsi+8]
test ebx,ebx
jle short M00_L01
M00_L00:
movsxd rcx,edi
lea rcx,[rcx+rcx*2]
lea rcx,[rsi+rcx*8+10]
call System.Drawing.Color.GetHue()
vaddss xmm6,xmm0,xmm6
inc edi
cmp ebx,edi
jg short M00_L00
M00_L01:
vmovaps xmm0,xmm6
vmovaps xmm6,[rsp+20]
add rsp,30
pop rbx
pop rsi
pop rdi
ret
; Total bytes of code 87 ; System.Drawing.Color.GetHue()
sub rsp,28
vzeroupper
call System.Drawing.Color.get_Value()
mov edx,eax
and edx,0FF0000
sar edx,10
mov ecx,eax
and ecx,0FF00
sar ecx,8
and eax,0FF
cmp edx,ecx
jne short M01_L00
cmp ecx,eax
jne short M01_L00
vxorps xmm0,xmm0,xmm0
add rsp,28
ret
M01_L00:
mov r8d,edx
mov r9d,ecx
cmp r8d,r9d
jle short M01_L01
mov r8d,ecx
jmp short M01_L02
M01_L01:
mov r8d,edx
M01_L02:
mov r9d,eax
cmp r8d,r9d
jle short M01_L03
mov r9d,eax
jmp short M01_L04
M01_L03:
mov r9d,r8d
M01_L04:
mov r8d,edx
mov r10d,ecx
cmp r8d,r10d
jge short M01_L05
mov r8d,ecx
jmp short M01_L06
M01_L05:
mov r8d,edx
M01_L06:
mov r10d,eax
cmp r8d,r10d
jge short M01_L07
mov r10d,eax
jmp short M01_L08
M01_L07:
mov r10d,r8d
M01_L08:
mov r8d,r10d
sub r8d,r9d
vxorps xmm0,xmm0,xmm0
vcvtsi2ss xmm0,xmm0,r8d
cmp edx,r10d
jne short M01_L09
sub ecx,eax
vxorps xmm1,xmm1,xmm1
vcvtsi2ss xmm1,xmm1,ecx
vdivss xmm0,xmm1,xmm0
jmp short M01_L11
M01_L09:
cmp ecx,r10d
jne short M01_L10
sub eax,edx
vxorps xmm1,xmm1,xmm1
vcvtsi2ss xmm1,xmm1,eax
vdivss xmm0,xmm1,xmm0
vaddss xmm0,xmm0,dword ptr [7FFE7D25A888]
jmp short M01_L11
M01_L10:
sub edx,ecx
vxorps xmm1,xmm1,xmm1
vcvtsi2ss xmm1,xmm1,edx
vdivss xmm0,xmm1,xmm0
vaddss xmm0,xmm0,dword ptr [7FFE7D25A88C]
M01_L11:
vmulss xmm0,xmm0,dword ptr [7FFE7D25A890]
vxorps xmm1,xmm1,xmm1
vucomiss xmm1,xmm0
jbe short M01_L12
vaddss xmm0,xmm0,dword ptr [7FFE7D25A894]
M01_L12:
add rsp,28
ret
; Total bytes of code 244 System.Drawing.Tests.Perf_Color.GetSaturation
Baseline Jit Disasm; System.Drawing.Tests.Perf_Color.GetSaturation()
push rdi
push rsi
push rbx
sub rsp,30
vzeroupper
vmovaps [rsp+20],xmm6
vxorps xmm6,xmm6,xmm6
mov rcx,11AD6217D88
mov rsi,[rcx]
xor edi,edi
mov ebx,[rsi+8]
test ebx,ebx
jle short M00_L01
M00_L00:
movsxd rcx,edi
lea rcx,[rcx+rcx*2]
lea rcx,[rsi+rcx*8+10]
call System.Drawing.Color.GetSaturation()
vaddss xmm6,xmm0,xmm6
inc edi
cmp ebx,edi
jg short M00_L00
M00_L01:
vmovaps xmm0,xmm6
vmovaps xmm6,[rsp+20]
add rsp,30
pop rbx
pop rsi
pop rdi
ret
; Total bytes of code 87 ; System.Drawing.Color.GetSaturation()
sub rsp,28
vzeroupper
call System.Drawing.Color.get_Value()
mov edx,eax
and edx,0FF0000
sar edx,10
mov ecx,eax
and ecx,0FF00
sar ecx,8
and eax,0FF
cmp edx,ecx
jne short M01_L00
cmp ecx,eax
jne short M01_L00
vxorps xmm0,xmm0,xmm0
add rsp,28
ret
M01_L00:
mov r8d,edx
mov r9d,ecx
cmp r8d,r9d
jle short M01_L01
mov r8d,ecx
jmp short M01_L02
M01_L01:
mov r8d,edx
M01_L02:
mov r9d,eax
cmp r8d,r9d
jle short M01_L03
mov r9d,eax
jmp short M01_L04
M01_L03:
mov r9d,r8d
M01_L04:
cmp edx,ecx
jge short M01_L05
jmp short M01_L06
M01_L05:
mov ecx,edx
M01_L06:
cmp ecx,eax
jge short M01_L07
jmp short M01_L08
M01_L07:
mov eax,ecx
M01_L08:
lea edx,[rax+r9]
cmp edx,0FF
jle short M01_L09
mov edx,eax
neg edx
add edx,1FE
sub edx,r9d
M01_L09:
sub eax,r9d
vxorps xmm0,xmm0,xmm0
vcvtsi2ss xmm0,xmm0,eax
vxorps xmm1,xmm1,xmm1
vcvtsi2ss xmm1,xmm1,edx
vdivss xmm0,xmm0,xmm1
add rsp,28
ret
; Total bytes of code 160 Compare Jit Disasm; System.Drawing.Tests.Perf_Color.GetSaturation()
push rdi
push rsi
push rbx
sub rsp,30
vzeroupper
vmovaps [rsp+20],xmm6
vxorps xmm6,xmm6,xmm6
mov rcx,1DCA7567D88
mov rsi,[rcx]
xor edi,edi
mov ebx,[rsi+8]
test ebx,ebx
jle short M00_L01
M00_L00:
movsxd rcx,edi
lea rcx,[rcx+rcx*2]
lea rcx,[rsi+rcx*8+10]
call System.Drawing.Color.GetSaturation()
vaddss xmm6,xmm0,xmm6
inc edi
cmp ebx,edi
jg short M00_L00
M00_L01:
vmovaps xmm0,xmm6
vmovaps xmm6,[rsp+20]
add rsp,30
pop rbx
pop rsi
pop rdi
ret
; Total bytes of code 87 ; System.Drawing.Color.GetSaturation()
sub rsp,28
vzeroupper
call System.Drawing.Color.get_Value()
mov edx,eax
and edx,0FF0000
sar edx,10
mov ecx,eax
and ecx,0FF00
sar ecx,8
and eax,0FF
cmp edx,ecx
jne short M01_L00
cmp ecx,eax
jne short M01_L00
vxorps xmm0,xmm0,xmm0
add rsp,28
ret
M01_L00:
mov r8d,edx
mov r9d,ecx
cmp r8d,r9d
jle short M01_L01
mov r8d,ecx
jmp short M01_L02
M01_L01:
mov r8d,edx
M01_L02:
mov r9d,eax
cmp r8d,r9d
jle short M01_L03
mov r9d,eax
jmp short M01_L04
M01_L03:
mov r9d,r8d
M01_L04:
cmp edx,ecx
jge short M01_L05
jmp short M01_L06
M01_L05:
mov ecx,edx
M01_L06:
cmp ecx,eax
jge short M01_L07
jmp short M01_L08
M01_L07:
mov eax,ecx
M01_L08:
lea edx,[rax+r9]
cmp edx,0FF
jle short M01_L09
mov edx,eax
neg edx
add edx,1FE
sub edx,r9d
M01_L09:
sub eax,r9d
vxorps xmm0,xmm0,xmm0
vcvtsi2ss xmm0,xmm0,eax
vxorps xmm1,xmm1,xmm1
vcvtsi2ss xmm1,xmm1,edx
vdivss xmm0,xmm0,xmm1
add rsp,28
ret
; Total bytes of code 160 DocsProfiling workflow for dotnet/runtime repository Run Information
Regressions in System.Drawing.Tests.Perf_Color
Related Issue on x64 ubuntu[Perf -12%] System.Drawing.Tests.Perf_Color.GetSaturation Related Issue on x64 ubuntu[Perf 23%] System.Drawing.Tests.Perf_Color.GetBrightness
Reprogit clone https://github.com/dotnet/performance.git
py .\performance\scripts\benchmarks_ci.py -f netcoreapp5.0 --filter 'System.Drawing.Tests.Perf_Color*' . PayloadsHistogramSystem.Drawing.Tests.Perf_Color.GetHue
Baseline Jit Disasm; System.Drawing.Tests.Perf_Color.GetHue()
push ebp
mov ebp,esp
push edi
push esi
push ebx
sub esp,8
vzeroupper
vxorps xmm0,xmm0,xmm0
vmovss dword ptr [ebp+0FFF0],xmm0
mov esi,ds:[46D4]
xor edi,edi
mov ebx,[esi+4]
test ebx,ebx
jle short M00_L03
M00_L00:
mov ecx,edi
shl ecx,4
lea ecx,[esi+ecx+8]
call System.Drawing.Color.GetHue()
fstp dword ptr [ebp+0FFEC]
vmovss xmm0,dword ptr [ebp+0FFEC]
vaddss xmm0,xmm0,dword ptr [ebp+0FFF0]
inc edi
cmp ebx,edi
jg short M00_L02
M00_L01:
vmovss dword ptr [ebp+0FFF0],xmm0
fld dword ptr [ebp+0FFF0]
lea esp,[ebp+0FFF4]
pop ebx
pop esi
pop edi
pop ebp
ret
M00_L02:
vmovss dword ptr [ebp+0FFF0],xmm0
jmp short M00_L00
M00_L03:
vmovss xmm0,dword ptr [ebp+0FFF0]
jmp short M00_L01
; Total bytes of code 98 ; System.Drawing.Color.GetHue()
push ebp
mov ebp,esp
push edi
push esi
push ebx
sub esp,0C
vzeroupper
call System.Drawing.Color.get_Value()
mov [ebp+0FFEC],eax
mov [ebp+0FFF0],edx
mov eax,[ebp+0FFEC]
mov edx,[ebp+0FFF0]
mov edx,eax
and edx,0FF0000
sar edx,10
mov ecx,eax
and ecx,0FF00
sar ecx,8
and eax,0FF
cmp edx,ecx
jne short M01_L00
cmp ecx,eax
jne short M01_L00
vxorps xmm0,xmm0,xmm0
vmovss dword ptr [ebp+0FFE8],xmm0
fld dword ptr [ebp+0FFE8]
lea esp,[ebp+0FFF4]
pop ebx
pop esi
pop edi
pop ebp
ret
M01_L00:
mov esi,edx
mov edi,ecx
cmp esi,edi
jle short M01_L01
mov esi,ecx
jmp short M01_L02
M01_L01:
mov esi,edx
M01_L02:
mov edi,eax
cmp esi,edi
jle short M01_L03
mov edi,eax
jmp short M01_L04
M01_L03:
mov edi,esi
M01_L04:
mov esi,edx
mov ebx,ecx
cmp esi,ebx
jge short M01_L05
mov esi,ecx
jmp short M01_L06
M01_L05:
mov esi,edx
M01_L06:
mov ebx,eax
cmp esi,ebx
jge short M01_L07
mov ebx,eax
jmp short M01_L08
M01_L07:
mov ebx,esi
M01_L08:
mov esi,ebx
sub esi,edi
vxorps xmm0,xmm0,xmm0
vcvtsi2ss xmm0,xmm0,esi
cmp edx,ebx
jne short M01_L09
sub ecx,eax
vxorps xmm1,xmm1,xmm1
vcvtsi2ss xmm1,xmm1,ecx
vdivss xmm1,xmm1,xmm0
jmp short M01_L11
M01_L09:
cmp ecx,ebx
jne short M01_L10
sub eax,edx
vxorps xmm1,xmm1,xmm1
vcvtsi2ss xmm1,xmm1,eax
vdivss xmm0,xmm1,xmm0
vaddss xmm1,xmm0,dword ptr ds:[0AEF8]
jmp short M01_L11
M01_L10:
sub edx,ecx
vxorps xmm1,xmm1,xmm1
vcvtsi2ss xmm1,xmm1,edx
vdivss xmm0,xmm1,xmm0
vaddss xmm1,xmm0,dword ptr ds:[0AEFC]
M01_L11:
vmulss xmm1,xmm1,dword ptr ds:[0AF00]
vxorps xmm0,xmm0,xmm0
vucomiss xmm0,xmm1
jbe short M01_L12
vaddss xmm1,xmm1,dword ptr ds:[0AF04]
M01_L12:
vmovss dword ptr [ebp+0FFE8],xmm1
fld dword ptr [ebp+0FFE8]
lea esp,[ebp+0FFF4]
pop ebx
pop esi
pop edi
pop ebp
ret
; Total bytes of code 260 Compare Jit Disasm; System.Drawing.Tests.Perf_Color.GetHue()
push ebp
mov ebp,esp
push edi
push esi
push ebx
sub esp,8
vzeroupper
vxorps xmm0,xmm0,xmm0
vmovss dword ptr [ebp+0FFF0],xmm0
mov esi,ds:[46D4]
xor edi,edi
mov ebx,[esi+4]
test ebx,ebx
jle short M00_L03
M00_L00:
mov ecx,edi
shl ecx,4
lea ecx,[esi+ecx+8]
call System.Drawing.Color.GetHue()
fstp dword ptr [ebp+0FFEC]
vmovss xmm0,dword ptr [ebp+0FFEC]
vaddss xmm0,xmm0,dword ptr [ebp+0FFF0]
inc edi
cmp ebx,edi
jg short M00_L02
M00_L01:
vmovss dword ptr [ebp+0FFF0],xmm0
fld dword ptr [ebp+0FFF0]
lea esp,[ebp+0FFF4]
pop ebx
pop esi
pop edi
pop ebp
ret
M00_L02:
vmovss dword ptr [ebp+0FFF0],xmm0
jmp short M00_L00
M00_L03:
vmovss xmm0,dword ptr [ebp+0FFF0]
jmp short M00_L01
; Total bytes of code 98 ; System.Drawing.Color.GetHue()
push ebp
mov ebp,esp
push edi
push esi
push ebx
sub esp,0C
vzeroupper
call System.Drawing.Color.get_Value()
mov [ebp+0FFEC],eax
mov [ebp+0FFF0],edx
mov eax,[ebp+0FFEC]
mov edx,[ebp+0FFF0]
mov edx,eax
and edx,0FF0000
sar edx,10
mov ecx,eax
and ecx,0FF00
sar ecx,8
and eax,0FF
cmp edx,ecx
jne short M01_L00
cmp ecx,eax
jne short M01_L00
vxorps xmm0,xmm0,xmm0
vmovss dword ptr [ebp+0FFE8],xmm0
fld dword ptr [ebp+0FFE8]
lea esp,[ebp+0FFF4]
pop ebx
pop esi
pop edi
pop ebp
ret
M01_L00:
mov esi,edx
mov edi,ecx
cmp esi,edi
jle short M01_L01
mov esi,ecx
jmp short M01_L02
M01_L01:
mov esi,edx
M01_L02:
mov edi,eax
cmp esi,edi
jle short M01_L03
mov edi,eax
jmp short M01_L04
M01_L03:
mov edi,esi
M01_L04:
mov esi,edx
mov ebx,ecx
cmp esi,ebx
jge short M01_L05
mov esi,ecx
jmp short M01_L06
M01_L05:
mov esi,edx
M01_L06:
mov ebx,eax
cmp esi,ebx
jge short M01_L07
mov ebx,eax
jmp short M01_L08
M01_L07:
mov ebx,esi
M01_L08:
mov esi,ebx
sub esi,edi
vxorps xmm0,xmm0,xmm0
vcvtsi2ss xmm0,xmm0,esi
cmp edx,ebx
jne short M01_L09
sub ecx,eax
vxorps xmm1,xmm1,xmm1
vcvtsi2ss xmm1,xmm1,ecx
vdivss xmm1,xmm1,xmm0
jmp short M01_L11
M01_L09:
cmp ecx,ebx
jne short M01_L10
sub eax,edx
vxorps xmm1,xmm1,xmm1
vcvtsi2ss xmm1,xmm1,eax
vdivss xmm0,xmm1,xmm0
vaddss xmm1,xmm0,dword ptr ds:[0B458]
jmp short M01_L11
M01_L10:
sub edx,ecx
vxorps xmm1,xmm1,xmm1
vcvtsi2ss xmm1,xmm1,edx
vdivss xmm0,xmm1,xmm0
vaddss xmm1,xmm0,dword ptr ds:[0B45C]
M01_L11:
vmulss xmm1,xmm1,dword ptr ds:[0B460]
vxorps xmm0,xmm0,xmm0
vucomiss xmm0,xmm1
jbe short M01_L12
vaddss xmm1,xmm1,dword ptr ds:[0B464]
M01_L12:
vmovss dword ptr [ebp+0FFE8],xmm1
fld dword ptr [ebp+0FFE8]
lea esp,[ebp+0FFF4]
pop ebx
pop esi
pop edi
pop ebp
ret
; Total bytes of code 260 System.Drawing.Tests.Perf_Color.FromArgb_AlphaColor
Baseline Jit Disasm; System.Drawing.Tests.Perf_Color.FromArgb_AlphaColor()
push ebp
mov ebp,esp
vzeroupper
add ecx,4
push [ecx+0C]
push [ecx+8]
push [ecx+4]
push [ecx]
mov ecx,edx
mov edx,0FF
call System.Drawing.Color.FromArgb(Int32, System.Drawing.Color)
pop ebp
ret
; Total bytes of code 34 ; System.Drawing.Color.FromArgb(Int32, System.Drawing.Color)
push ebp
mov ebp,esp
push edi
push esi
push ebx
sub esp,8
mov esi,ecx
mov edi,edx
cmp edi,0FF
ja short M01_L03
test byte ptr [ebp+16],2
je short M01_L00
mov ebx,[ebp+8]
jmp short M01_L02
M01_L00:
test byte ptr [ebp+16],1
je short M01_L01
movsx ecx,word ptr [ebp+14]
call System.Drawing.KnownColorTable.KnownColorToArgb(System.Drawing.KnownColor)
mov ebx,eax
jmp short M01_L02
M01_L01:
xor ebx,ebx
M01_L02:
shl edi,18
and ebx,0FFFFFF
or edi,ebx
xor edx,edx
mov [ebp+0FFEC],edi
mov [ebp+0FFF0],edx
mov edx,2
xor ecx,ecx
mov eax,esi
mov edi,[ebp+0FFEC]
mov [eax],edi
mov edi,[ebp+0FFF0]
mov [eax+4],edi
xor eax,eax
mov [esi+8],eax
mov [esi+0C],cx
mov [esi+0E],dx
lea esp,[ebp+0FFF4]
pop ebx
pop esi
pop edi
pop ebp
ret 10
M01_L03:
mov edx,ds:[5988]
mov ecx,edi
call System.Drawing.Color.<CheckByte>g__ThrowOutOfByteRange|325_0(Int32, System.String)
int 3
; Total bytes of code 129 Compare Jit Disasm; System.Drawing.Tests.Perf_Color.FromArgb_AlphaColor()
push ebp
mov ebp,esp
vzeroupper
add ecx,4
push [ecx+0C]
push [ecx+8]
push [ecx+4]
push [ecx]
mov ecx,edx
mov edx,0FF
call System.Drawing.Color.FromArgb(Int32, System.Drawing.Color)
pop ebp
ret
; Total bytes of code 34 ; System.Drawing.Color.FromArgb(Int32, System.Drawing.Color)
push ebp
mov ebp,esp
push edi
push esi
push ebx
sub esp,8
mov esi,ecx
mov edi,edx
cmp edi,0FF
ja short M01_L03
test byte ptr [ebp+16],2
je short M01_L00
mov ebx,[ebp+8]
jmp short M01_L02
M01_L00:
test byte ptr [ebp+16],1
je short M01_L01
movsx ecx,word ptr [ebp+14]
call System.Drawing.KnownColorTable.KnownColorToArgb(System.Drawing.KnownColor)
mov ebx,eax
jmp short M01_L02
M01_L01:
xor ebx,ebx
M01_L02:
shl edi,18
and ebx,0FFFFFF
or edi,ebx
xor edx,edx
mov [ebp+0FFEC],edi
mov [ebp+0FFF0],edx
mov edx,2
xor ecx,ecx
mov eax,esi
mov edi,[ebp+0FFEC]
mov [eax],edi
mov edi,[ebp+0FFF0]
mov [eax+4],edi
xor eax,eax
mov [esi+8],eax
mov [esi+0C],cx
mov [esi+0E],dx
lea esp,[ebp+0FFF4]
pop ebx
pop esi
pop edi
pop ebp
ret 10
M01_L03:
mov edx,ds:[5988]
mov ecx,edi
call System.Drawing.Color.<CheckByte>g__ThrowOutOfByteRange|327_0(Int32, System.String)
int 3
; Total bytes of code 129 DocsProfiling workflow for dotnet/runtime repository
|
@tannergooding could it be possible to the tweak we did to handle the miss matches with the new additions to get known colors? |
I had recently added some automated support for bracketing the commit, but was still in the testing phase of this. While I was doing this I took out the diff link. This is what was found by the tool for one of the regressions, 5432a66...d32f446. This is a pretty tight bound, so I think I will go ahead and turn the diff link back on, using these bounds. |
@safern, I don't think so. The [Benchmark]
public float GetHue()
{
float hue = 0.0f;
var colors = AllKnownColors;
for (int j = 0; j < colors.Length; j++)
hue += colors[j].GetHue();
return hue;
} While the implementation of runtime/src/libraries/System.Drawing.Primitives/src/System/Drawing/Color.cs Lines 499 to 524 in 5078dd6
It's all just trivial math, no lookups, etc |
Hmm interesting. I thought it impacted the Do you see anything in between that commit range that could've caused this? |
Nothing obvious pops out. It shouldn't even be because of the new color, since it wasn't added to |
* Fixes perf issue dotnet#46153 related to commit d21fe17 * Brings the following dotnet/performance microbenchmarks back on par with .NET5 * System.Drawing.Tests.Perf_Color.GetBrightness * System.Drawing.Tests.Perf_Color.GetSaturation * System.Drawing.Tests.Perf_Color.GetHue * Use one known color table for both system and non-system colors (indexed by the corresponding KnownColor enum value). * This table stores both the color value and color category. * Add color category enum for Unknown, System, and Web. * Combined table removes the need to handle mismatches corresponding with the KnownColor enum value. * Obtaining the value of and verifying if a known color is a system color is simplified to a single lookup instead of multiple base bounds comparisons inside the fragmented KnownColor enum table. * These base bounds comparisons would grow linearly as the KnownColor enum table had more colors added to it, mixed between system and non-system. Now no comparisons are needed.
I did some profiling for this issue and have added the fix here: #50489 |
Run Information
Regressions in System.Drawing.Tests.Perf_Color
Historical Data in Reporting System
Repro
.
Payloads
Baseline
Compare
Histogram
System.Drawing.Tests.Perf_Color.GetHue
System.Drawing.Tests.Perf_Color.FromArgb_AlphaColor
Docs
Profiling workflow for dotnet/runtime repository
Benchmarking workflow for dotnet/runtime repository
Run Information
Regressions in System.Drawing.Tests.Perf_Color
Related Issue on x64 ubuntu
[Perf -12%] System.Drawing.Tests.Perf_Color.GetSaturation
Related Issue on x64 ubuntu
[Perf 23%] System.Drawing.Tests.Perf_Color.GetBrightness
Historical Data in Reporting System
Repro
.
Payloads
Baseline
Compare
Histogram
System.Drawing.Tests.Perf_Color.GetHue
Baseline Jit Disasm
Compare Jit Disasm
System.Drawing.Tests.Perf_Color.GetSaturation
Baseline Jit Disasm
Compare Jit Disasm
Docs
Profiling workflow for dotnet/runtime repository
Benchmarking workflow for dotnet/runtime repository
Run Information
Regressions in System.Drawing.Tests.Perf_Color
Related Issue on x64 ubuntu
[Perf -12%] System.Drawing.Tests.Perf_Color.GetSaturation
Related Issue on x64 ubuntu
[Perf 23%] System.Drawing.Tests.Perf_Color.GetBrightness
Historical Data in Reporting System
Repro
.
Payloads
Baseline
Compare
Histogram
System.Drawing.Tests.Perf_Color.GetHue
Baseline Jit Disasm
Compare Jit Disasm
System.Drawing.Tests.Perf_Color.FromArgb_AlphaColor
Baseline Jit Disasm
Compare Jit Disasm
Docs
Profiling workflow for dotnet/runtime repository
Benchmarking workflow for dotnet/runtime repository
The text was updated successfully, but these errors were encountered: