dotnet / perf-autofiling-issues

A landing place for auto-filed performance issues before they receive triage
MIT License
9 stars 4 forks source link

[Perf] Windows/x86: 5 Improvements on 1/30/2023 2:40:17 PM #12490

Open performanceautofiler[bot] opened 1 year ago

performanceautofiler[bot] commented 1 year ago

Run Information

Architecture x86
OS Windows 10.0.18362
Baseline 02682ad6397b2833660b104780a9d361f2cba6d7
Compare b5e79f56d1ed06dbf6765b29c021726ff4195e91
Diff Diff

Improvements in System.Collections.Tests.Perf_BitArray

Benchmark Baseline Test Test/Base Test Quality Edge Detector Baseline IR Compare IR IR Ratio Baseline ETL Compare ETL
[BitArraySetLengthShrink - Duration of single invocation](<https://pvscmdupload.z22.web.core.windows.net/reports/allTestHistory/refs/heads/main_x86_Windows 10.0.18362/System.Collections.Tests.Perf_BitArray.BitArraySetLengthShrink(Size%3a%20512).html>) 282.20 ns 261.88 ns 0.93 0.00 False Trace Trace
[BitArrayByteArrayCtor - Duration of single invocation](<https://pvscmdupload.z22.web.core.windows.net/reports/allTestHistory/refs/heads/main_x86_Windows 10.0.18362/System.Collections.Tests.Perf_BitArray.BitArrayByteArrayCtor(Size%3a%20512).html>) 277.99 ns 260.96 ns 0.94 0.00 False 3544.797412973179 3296.0702817256943 0.929833188678936 Trace Trace
[BitArraySetLengthGrow - Duration of single invocation](<https://pvscmdupload.z22.web.core.windows.net/reports/allTestHistory/refs/heads/main_x86_Windows 10.0.18362/System.Collections.Tests.Perf_BitArray.BitArraySetLengthGrow(Size%3a%20512).html>) 383.01 ns 360.41 ns 0.94 0.00 False 4148.197103616474 3891.114923105808 0.9380255628917591 Trace Trace

graph graph graph Test Report

Repro

git clone https://github.com/dotnet/performance.git
py .\performance\scripts\benchmarks_ci.py -f net8.0 --filter 'System.Collections.Tests.Perf_BitArray*'
### Payloads [Baseline]() [Compare]() ### Histogram #### System.Collections.Tests.Perf_BitArray.BitArraySetLengthShrink(Size: 512) ```log ``` ### Description of detection logic ```IsRegressionBase: Marked as not a regression because the compare was not 5% greater than the baseline, or the value was too small. IsImprovementBase: Marked as improvement because the compare was 5% less than the baseline, and the value was not too small. IsImprovementCheck: Marked as improvement because the three check build points were 0.05 less than the baseline. IsRegressionBase: Marked as not a regression because the compare was not 5% greater than the baseline, or the value was too small. IsImprovementBase: Marked as improvement because the compare was 5% less than the baseline, and the value was not too small. IsImprovementCheck: Marked as improvement because the three check build points were 0.05 less than the baseline. IsImprovementWindowed:Marked as improvement because 261.8813262998059 < 268.2020965286147. IsChangePoint: Marked as a change because one of 1/30/2023 11:52:26 AM, 2/7/2023 8:22:47 AM falls between 1/29/2023 5:12:48 PM and 2/7/2023 8:22:47 AM. IsImprovementStdDev: Marked as improvement because 61.855501162251514 (T) = (0 -263.29550451755125) / Math.Sqrt((3.3147341443981375 / (299)) + (4.299823664106643 / (43))) is greater than 1.9669657340893643 = MathNet.Numerics.Distributions.StudentT.InvCDF(0, 1, (299) + (43) - 2, .975) and 0.07261351005849635 = (283.9113005993424 - 263.29550451755125) / 283.9113005993424 is greater than 0.05. IsChangeEdgeDetector: Marked not as a regression because Edge Detector said so. ```### Baseline Jit Disasm ```assembly ; System.Collections.Tests.Perf_BitArray.BitArraySetLengthShrink() push ebp mov ebp,esp push edi push esi mov esi,ecx mov ecx,offset MT_System.Collections.BitArray call CORINFO_HELP_NEWSFAST mov edi,eax mov edx,[esi+0C] mov ecx,edi call dword ptr ds:[0ACB9030]; System.Collections.BitArray..ctor(Byte[]) mov edx,[edi+8] mov ecx,edx shr ecx,1F add edx,ecx sar edx,1 mov ecx,edi call dword ptr ds:[0ACB91B0]; System.Collections.BitArray.set_Length(Int32) mov eax,edi pop esi pop edi pop ebp ret ; Total bytes of code 56 ``` ```assembly ; System.Collections.BitArray..ctor(Byte[]) push ebp mov ebp,esp push edi push esi push ebx sub esp,18 mov esi,ecx mov edi,edx M01_L00: test edi,edi je near ptr M01_L06 mov ebx,[edi+4] cmp ebx,0FFFFFFF jg near ptr M01_L07 mov edx,ebx add edx,3 shr edx,2 mov ecx,offset MT_System.Int32[] call CORINFO_HELP_NEWARR_1_VC lea edx,[esi+4] call CORINFO_HELP_ASSIGN_REF_EAX lea ecx,[ebx*8] mov [esi+8],ecx mov ecx,ebx shr ecx,2 mov [ebp-10],ecx add edi,8 xor edx,edx xor eax,eax mov [ebp-18],ecx mov [ebp-1C],eax cmp ecx,1 sbb eax,0 jl short M01_L04 M01_L01: mov [ebp-20],esi mov eax,[esi+4] mov [ebp-24],edi mov ecx,ebx cmp ecx,4 jl near ptr M01_L08 mov ecx,[ebp-24] mov ecx,[ecx] cmp edx,[eax+4] jae near ptr M01_L10 mov [eax+edx*4+8],ecx cmp ebx,4 jb near ptr M01_L09 add edi,4 add ebx,0FFFFFFFC inc edx mov ecx,edx mov eax,ecx sar eax,1F mov esi,[ebp-18] cmp ecx,esi mov ecx,[ebp-1C] sbb eax,ecx jl short M01_L03 M01_L02: xor ecx,ecx mov [ebp-14],ecx lea edx,[ebx-1] cmp edx,2 ja short M01_L05 lea eax,ds:[0B5E0B48] mov eax,[eax+edx*4] lea ecx,[M01_L00] add eax,ecx jmp eax M01_L03: mov esi,[ebp-20] jmp short M01_L01 M01_L04: mov [ebp-20],esi jmp short M01_L02 cmp ebx,2 jbe near ptr M01_L10 movzx ecx,byte ptr [edi+2] shl ecx,10 mov [ebp-14],ecx cmp ebx,1 jbe near ptr M01_L10 movzx edx,byte ptr [edi+1] shl edx,8 mov ecx,edx or ecx,[ebp-14] mov [ebp-14],ecx mov esi,[ebp-20] mov edx,[esi+4] test ebx,ebx je near ptr M01_L10 movzx eax,byte ptr [edi] or eax,[ebp-14] mov ecx,[ebp-10] cmp ecx,[edx+4] jae near ptr M01_L10 mov [edx+ecx*4+8],eax mov [ebp-20],esi M01_L05: xor edx,edx mov esi,[ebp-20] mov [esi+0C],edx lea esp,[ebp-0C] pop ebx pop esi pop edi pop ebp ret M01_L06: mov ecx,783 mov edx,0AB33060 call CORINFO_HELP_STRCNS mov ecx,eax call dword ptr ds:[8AE5AF8] int 3 M01_L07: mov ecx,offset MT_System.Int32 call CORINFO_HELP_NEWSFAST mov esi,eax call dword ptr ds:[0B5CBB40] mov edi,eax mov dword ptr [esi+4],8 mov ecx,offset MT_System.ArgumentException call CORINFO_HELP_NEWSFAST mov ebx,eax mov edx,esi mov ecx,edi call dword ptr ds:[0B5CB948] mov esi,eax mov ecx,783 mov edx,0AB33060 call CORINFO_HELP_STRCNS push eax mov edx,esi mov ecx,ebx call dword ptr ds:[506BBA0] mov ecx,ebx call CORINFO_HELP_THROW M01_L08: mov ecx,29 call dword ptr ds:[8B45528] int 3 M01_L09: call dword ptr ds:[8B451E0] int 3 M01_L10: call CORINFO_HELP_RNGCHKFAIL int 3 ; Total bytes of code 447 ``` ```assembly ; System.Collections.BitArray.set_Length(Int32) push ebp mov ebp,esp push edi push esi push ebx push eax mov esi,ecx mov edi,edx test edi,edi jl near ptr M02_L05 lea ebx,[edi+1F] shr ebx,5 mov ecx,[esi+4] cmp [ecx+4],ebx jl short M02_L00 mov ecx,[esi+4] lea edx,[ebx+100] cmp [ecx+4],edx jle short M02_L01 M02_L00: lea ecx,[esi+4] mov edx,ebx call dword ptr ds:[0B5CBFC0] M02_L01: mov ecx,[esi+8] cmp edi,ecx jle short M02_L04 lea edx,[ecx-1] sar edx,5 mov [ebp-10],edx and ecx,1F jle short M02_L02 mov eax,[esi+4] cmp edx,[eax+4] jae short M02_L08 lea eax,[eax+edx*4+8] mov edx,1 shl edx,cl dec edx and [eax],edx mov edx,[ebp-10] M02_L02: mov ecx,[esi+4] lea eax,[edx+1] sub ebx,edx dec ebx test ecx,ecx je short M02_L06 cmp [ecx+4],eax jb short M02_L07 mov edx,[ecx+4] sub edx,eax cmp edx,ebx jb short M02_L07 lea ecx,[ecx+eax*4+8] mov edx,ebx M02_L03: shl edx,2 call dword ptr ds:[506F3A8]; System.SpanHelpers.ClearWithoutReferences(Byte ByRef, UIntPtr) M02_L04: mov [esi+8],edi inc dword ptr [esi+0C] pop ecx pop ebx pop esi pop edi pop ebp ret M02_L05: mov ecx,7A7 mov edx,0AB33060 call CORINFO_HELP_STRCNS mov ecx,eax mov edx,edi call dword ptr ds:[8AD5F60] int 3 M02_L06: or eax,ebx jne short M02_L07 xor ecx,ecx xor edx,edx jmp short M02_L03 M02_L07: call dword ptr ds:[8B451E0] int 3 M02_L08: call CORINFO_HELP_RNGCHKFAIL int 3 ; Total bytes of code 207 ``` ### Compare Jit Disasm ```assembly ; System.Collections.Tests.Perf_BitArray.BitArraySetLengthShrink() push ebp mov ebp,esp push edi push esi mov esi,ecx mov ecx,offset MT_System.Collections.BitArray call CORINFO_HELP_NEWSFAST mov edi,eax mov edx,[esi+0C] mov ecx,edi call dword ptr ds:[0B079030]; System.Collections.BitArray..ctor(Byte[]) mov edx,[edi+8] mov ecx,edx shr ecx,1F add edx,ecx sar edx,1 mov ecx,edi call dword ptr ds:[0B0791B0]; System.Collections.BitArray.set_Length(Int32) mov eax,edi pop esi pop edi pop ebp ret ; Total bytes of code 56 ``` ```assembly ; System.Collections.BitArray..ctor(Byte[]) push ebp mov ebp,esp push edi push esi push ebx sub esp,14 mov esi,ecx mov edi,edx M01_L00: test edi,edi je near ptr M01_L06 mov ebx,[edi+4] cmp ebx,0FFFFFFF jg near ptr M01_L07 mov edx,ebx add edx,3 shr edx,2 mov ecx,offset MT_System.Int32[] call CORINFO_HELP_NEWARR_1_VC lea edx,[esi+4] call CORINFO_HELP_ASSIGN_REF_EAX lea ecx,[ebx*8] mov [esi+8],ecx mov ecx,ebx shr ecx,2 mov [ebp-10],ecx add edi,8 xor edx,edx xor eax,eax mov [ebp-18],ecx mov [ebp-1C],eax cmp ecx,1 sbb eax,0 jl short M01_L04 M01_L01: mov [ebp-20],esi mov eax,[esi+4] mov ecx,edi cmp ebx,4 jl near ptr M01_L08 mov ecx,[ecx] cmp edx,[eax+4] jae near ptr M01_L10 mov [eax+edx*4+8],ecx cmp ebx,4 jb near ptr M01_L09 add edi,4 add ebx,0FFFFFFFC inc edx mov ecx,edx mov eax,ecx sar eax,1F mov esi,[ebp-18] cmp ecx,esi mov ecx,[ebp-1C] sbb eax,ecx jl short M01_L03 M01_L02: xor ecx,ecx mov [ebp-14],ecx lea edx,[ebx-1] cmp edx,2 ja short M01_L05 lea eax,ds:[0B9A0B40] mov eax,[eax+edx*4] lea ecx,[M01_L00] add eax,ecx jmp eax M01_L03: mov esi,[ebp-20] jmp short M01_L01 M01_L04: mov [ebp-20],esi jmp short M01_L02 cmp ebx,2 jbe near ptr M01_L10 movzx ecx,byte ptr [edi+2] shl ecx,10 mov [ebp-14],ecx cmp ebx,1 jbe near ptr M01_L10 movzx edx,byte ptr [edi+1] shl edx,8 mov ecx,edx or ecx,[ebp-14] mov [ebp-14],ecx mov esi,[ebp-20] mov edx,[esi+4] test ebx,ebx je near ptr M01_L10 movzx eax,byte ptr [edi] or eax,[ebp-14] mov ecx,[ebp-10] cmp ecx,[edx+4] jae near ptr M01_L10 mov [edx+ecx*4+8],eax mov [ebp-20],esi M01_L05: xor edx,edx mov esi,[ebp-20] mov [esi+0C],edx lea esp,[ebp-0C] pop ebx pop esi pop edi pop ebp ret M01_L06: mov ecx,783 mov edx,0AF13440 call CORINFO_HELP_STRCNS mov ecx,eax call dword ptr ds:[8E35AF8] int 3 M01_L07: mov ecx,offset MT_System.Int32 call CORINFO_HELP_NEWSFAST mov esi,eax call dword ptr ds:[0B98BB40] mov edi,eax mov dword ptr [esi+4],8 mov ecx,offset MT_System.ArgumentException call CORINFO_HELP_NEWSFAST mov ebx,eax mov edx,esi mov ecx,edi call dword ptr ds:[0B98B948] mov esi,eax mov ecx,783 mov edx,0AF13440 call CORINFO_HELP_STRCNS push eax mov edx,esi mov ecx,ebx call dword ptr ds:[87ABBA0] mov ecx,ebx call CORINFO_HELP_THROW M01_L08: mov ecx,29 call dword ptr ds:[8E955B8] int 3 M01_L09: call dword ptr ds:[8E95270] int 3 M01_L10: call CORINFO_HELP_RNGCHKFAIL int 3 ; Total bytes of code 441 ``` ```assembly ; System.Collections.BitArray.set_Length(Int32) push ebp mov ebp,esp push edi push esi push ebx push eax mov esi,ecx mov edi,edx test edi,edi jl near ptr M02_L05 lea ebx,[edi+1F] shr ebx,5 mov ecx,[esi+4] cmp [ecx+4],ebx jl short M02_L00 mov ecx,[esi+4] lea edx,[ebx+100] cmp [ecx+4],edx jle short M02_L01 M02_L00: lea ecx,[esi+4] mov edx,ebx call dword ptr ds:[0B98BFC0] M02_L01: mov ecx,[esi+8] cmp edi,ecx jle short M02_L04 lea edx,[ecx-1] sar edx,5 mov [ebp-10],edx and ecx,1F jle short M02_L02 mov eax,[esi+4] cmp edx,[eax+4] jae short M02_L08 lea eax,[eax+edx*4+8] mov edx,1 shl edx,cl dec edx and [eax],edx mov edx,[ebp-10] M02_L02: mov ecx,[esi+4] lea eax,[edx+1] sub ebx,edx dec ebx test ecx,ecx je short M02_L06 cmp [ecx+4],eax jb short M02_L07 mov edx,[ecx+4] sub edx,eax cmp edx,ebx jb short M02_L07 lea ecx,[ecx+eax*4+8] mov edx,ebx M02_L03: shl edx,2 call dword ptr ds:[87AF390]; System.SpanHelpers.ClearWithoutReferences(Byte ByRef, UIntPtr) M02_L04: mov [esi+8],edi inc dword ptr [esi+0C] pop ecx pop ebx pop esi pop edi pop ebp ret M02_L05: mov ecx,7A7 mov edx,0AF13440 call CORINFO_HELP_STRCNS mov ecx,eax mov edx,edi call dword ptr ds:[8E55F60] int 3 M02_L06: or eax,ebx jne short M02_L07 xor ecx,ecx xor edx,edx jmp short M02_L03 M02_L07: call dword ptr ds:[8E95270] int 3 M02_L08: call CORINFO_HELP_RNGCHKFAIL int 3 ; Total bytes of code 207 ``` #### System.Collections.Tests.Perf_BitArray.BitArrayByteArrayCtor(Size: 512) ```log ``` ### Description of detection logic ```IsRegressionBase: Marked as not a regression because the compare was not 5% greater than the baseline, or the value was too small. IsImprovementBase: Marked as improvement because the compare was 5% less than the baseline, and the value was not too small. IsImprovementCheck: Marked as improvement because the three check build points were 0.05 less than the baseline. IsRegressionBase: Marked as not a regression because the compare was not 5% greater than the baseline, or the value was too small. IsImprovementBase: Marked as improvement because the compare was 5% less than the baseline, and the value was not too small. IsImprovementCheck: Marked as improvement because the three check build points were 0.05 less than the baseline. IsImprovementWindowed:Marked as improvement because 260.9630486428867 < 264.17358206728613. IsChangePoint: Marked as a change because one of 1/30/2023 11:52:26 AM, 2/7/2023 8:22:47 AM falls between 1/29/2023 5:12:48 PM and 2/7/2023 8:22:47 AM. IsImprovementStdDev: Marked as improvement because 109.89753719869479 (T) = (0 -258.95347838665924) / Math.Sqrt((1.4323229587396062 / (299)) + (1.3015474163963137 / (43))) is greater than 1.9669657340893643 = MathNet.Numerics.Distributions.StudentT.InvCDF(0, 1, (299) + (43) - 2, .975) and 0.07361353812350623 = (279.53072399408944 - 258.95347838665924) / 279.53072399408944 is greater than 0.05. IsChangeEdgeDetector: Marked not as a regression because Edge Detector said so. ```### Baseline Jit Disasm ```assembly ; System.Collections.Tests.Perf_BitArray.BitArrayByteArrayCtor() push edi push esi mov esi,ecx mov ecx,offset MT_System.Collections.BitArray call CORINFO_HELP_NEWSFAST mov edi,eax mov edx,[esi+0C] mov ecx,edi call dword ptr ds:[0B179030]; System.Collections.BitArray..ctor(Byte[]) mov eax,edi pop esi pop edi ret ; Total bytes of code 32 ``` ```assembly ; System.Collections.BitArray..ctor(Byte[]) push ebp mov ebp,esp push edi push esi push ebx sub esp,18 mov esi,ecx mov edi,edx M01_L00: test edi,edi je near ptr M01_L06 mov ebx,[edi+4] cmp ebx,0FFFFFFF jg near ptr M01_L07 mov edx,ebx add edx,3 shr edx,2 mov ecx,offset MT_System.Int32[] call CORINFO_HELP_NEWARR_1_VC lea edx,[esi+4] call CORINFO_HELP_ASSIGN_REF_EAX lea ecx,[ebx*8] mov [esi+8],ecx mov ecx,ebx shr ecx,2 mov [ebp-10],ecx add edi,8 xor edx,edx xor eax,eax mov [ebp-18],ecx mov [ebp-1C],eax cmp ecx,1 sbb eax,0 jl short M01_L04 M01_L01: mov [ebp-20],esi mov eax,[esi+4] mov [ebp-24],edi mov ecx,ebx cmp ecx,4 jl near ptr M01_L08 mov ecx,[ebp-24] mov ecx,[ecx] cmp edx,[eax+4] jae near ptr M01_L10 mov [eax+edx*4+8],ecx cmp ebx,4 jb near ptr M01_L09 add edi,4 add ebx,0FFFFFFFC inc edx mov ecx,edx mov eax,ecx sar eax,1F mov esi,[ebp-18] cmp ecx,esi mov ecx,[ebp-1C] sbb eax,ecx jl short M01_L03 M01_L02: xor ecx,ecx mov [ebp-14],ecx lea edx,[ebx-1] cmp edx,2 ja short M01_L05 lea eax,ds:[0BAA0B28] mov eax,[eax+edx*4] lea ecx,[M01_L00] add eax,ecx jmp eax M01_L03: mov esi,[ebp-20] jmp short M01_L01 M01_L04: mov [ebp-20],esi jmp short M01_L02 cmp ebx,2 jbe near ptr M01_L10 movzx ecx,byte ptr [edi+2] shl ecx,10 mov [ebp-14],ecx cmp ebx,1 jbe near ptr M01_L10 movzx edx,byte ptr [edi+1] shl edx,8 mov ecx,edx or ecx,[ebp-14] mov [ebp-14],ecx mov esi,[ebp-20] mov edx,[esi+4] test ebx,ebx je near ptr M01_L10 movzx eax,byte ptr [edi] or eax,[ebp-14] mov ecx,[ebp-10] cmp ecx,[edx+4] jae near ptr M01_L10 mov [edx+ecx*4+8],eax mov [ebp-20],esi M01_L05: xor edx,edx mov esi,[ebp-20] mov [esi+0C],edx lea esp,[ebp-0C] pop ebx pop esi pop edi pop ebp ret M01_L06: mov ecx,783 mov edx,0AFF3060 call CORINFO_HELP_STRCNS mov ecx,eax call dword ptr ds:[8FA5AF8] int 3 M01_L07: mov ecx,offset MT_System.Int32 call CORINFO_HELP_NEWSFAST mov esi,eax call dword ptr ds:[0BA8BB40] mov edi,eax mov dword ptr [esi+4],8 mov ecx,offset MT_System.ArgumentException call CORINFO_HELP_NEWSFAST mov ebx,eax mov edx,esi mov ecx,edi call dword ptr ds:[0BA8B948] mov esi,eax mov ecx,783 mov edx,0AFF3060 call CORINFO_HELP_STRCNS push eax mov edx,esi mov ecx,ebx call dword ptr ds:[891BBA0] mov ecx,ebx call CORINFO_HELP_THROW M01_L08: mov ecx,29 call dword ptr ds:[9005528] int 3 M01_L09: call dword ptr ds:[90051E0] int 3 M01_L10: call CORINFO_HELP_RNGCHKFAIL int 3 ; Total bytes of code 447 ``` ### Compare Jit Disasm ```assembly ; System.Collections.Tests.Perf_BitArray.BitArrayByteArrayCtor() push edi push esi mov esi,ecx mov ecx,offset MT_System.Collections.BitArray call CORINFO_HELP_NEWSFAST mov edi,eax mov edx,[esi+0C] mov ecx,edi call dword ptr ds:[0AAC9030]; System.Collections.BitArray..ctor(Byte[]) mov eax,edi pop esi pop edi ret ; Total bytes of code 32 ``` ```assembly ; System.Collections.BitArray..ctor(Byte[]) push ebp mov ebp,esp push edi push esi push ebx sub esp,14 mov esi,ecx mov edi,edx M01_L00: test edi,edi je near ptr M01_L06 mov ebx,[edi+4] cmp ebx,0FFFFFFF jg near ptr M01_L07 mov edx,ebx add edx,3 shr edx,2 mov ecx,offset MT_System.Int32[] call CORINFO_HELP_NEWARR_1_VC lea edx,[esi+4] call CORINFO_HELP_ASSIGN_REF_EAX lea ecx,[ebx*8] mov [esi+8],ecx mov ecx,ebx shr ecx,2 mov [ebp-10],ecx add edi,8 xor edx,edx xor eax,eax mov [ebp-18],ecx mov [ebp-1C],eax cmp ecx,1 sbb eax,0 jl short M01_L04 M01_L01: mov [ebp-20],esi mov eax,[esi+4] mov ecx,edi cmp ebx,4 jl near ptr M01_L08 mov ecx,[ecx] cmp edx,[eax+4] jae near ptr M01_L10 mov [eax+edx*4+8],ecx cmp ebx,4 jb near ptr M01_L09 add edi,4 add ebx,0FFFFFFFC inc edx mov ecx,edx mov eax,ecx sar eax,1F mov esi,[ebp-18] cmp ecx,esi mov ecx,[ebp-1C] sbb eax,ecx jl short M01_L03 M01_L02: xor ecx,ecx mov [ebp-14],ecx lea edx,[ebx-1] cmp edx,2 ja short M01_L05 lea eax,ds:[0B400B20] mov eax,[eax+edx*4] lea ecx,[M01_L00] add eax,ecx jmp eax M01_L03: mov esi,[ebp-20] jmp short M01_L01 M01_L04: mov [ebp-20],esi jmp short M01_L02 cmp ebx,2 jbe near ptr M01_L10 movzx ecx,byte ptr [edi+2] shl ecx,10 mov [ebp-14],ecx cmp ebx,1 jbe near ptr M01_L10 movzx edx,byte ptr [edi+1] shl edx,8 mov ecx,edx or ecx,[ebp-14] mov [ebp-14],ecx mov esi,[ebp-20] mov edx,[esi+4] test ebx,ebx je near ptr M01_L10 movzx eax,byte ptr [edi] or eax,[ebp-14] mov ecx,[ebp-10] cmp ecx,[edx+4] jae near ptr M01_L10 mov [edx+ecx*4+8],eax mov [ebp-20],esi M01_L05: xor edx,edx mov esi,[ebp-20] mov [esi+0C],edx lea esp,[ebp-0C] pop ebx pop esi pop edi pop ebp ret M01_L06: mov ecx,783 mov edx,0A963440 call CORINFO_HELP_STRCNS mov ecx,eax call dword ptr ds:[88F5AF8] int 3 M01_L07: mov ecx,offset MT_System.Int32 call CORINFO_HELP_NEWSFAST mov esi,eax call dword ptr ds:[0B3DBB40] mov edi,eax mov dword ptr [esi+4],8 mov ecx,offset MT_System.ArgumentException call CORINFO_HELP_NEWSFAST mov ebx,eax mov edx,esi mov ecx,edi call dword ptr ds:[0B3DB948] mov esi,eax mov ecx,783 mov edx,0A963440 call CORINFO_HELP_STRCNS push eax mov edx,esi mov ecx,ebx call dword ptr ds:[826BBA0] mov ecx,ebx call CORINFO_HELP_THROW M01_L08: mov ecx,29 call dword ptr ds:[89555B8] int 3 M01_L09: call dword ptr ds:[8955270] int 3 M01_L10: call CORINFO_HELP_RNGCHKFAIL int 3 ; Total bytes of code 441 ``` #### System.Collections.Tests.Perf_BitArray.BitArraySetLengthGrow(Size: 512) ```log ``` ### Description of detection logic ```IsRegressionBase: Marked as not a regression because the compare was not 5% greater than the baseline, or the value was too small. IsImprovementBase: Marked as improvement because the compare was 5% less than the baseline, and the value was not too small. IsImprovementCheck: Marked as improvement because the three check build points were 0.05 less than the baseline. IsRegressionBase: Marked as not a regression because the compare was not 5% greater than the baseline, or the value was too small. IsImprovementBase: Marked as improvement because the compare was 5% less than the baseline, and the value was not too small. IsImprovementCheck: Marked as improvement because the three check build points were 0.05 less than the baseline. IsImprovementWindowed:Marked as improvement because 360.4093381139245 < 363.01654466220833. IsChangePoint: Marked as a change because one of 1/30/2023 11:52:26 AM, 2/7/2023 8:22:47 AM falls between 1/29/2023 5:12:48 PM and 2/7/2023 8:22:47 AM. IsImprovementStdDev: Marked as improvement because 66.36831729022987 (T) = (0 -362.6429305003794) / Math.Sqrt((3.363148976294933 / (299)) + (3.5899825470245745 / (43))) is greater than 1.9669657340893643 = MathNet.Numerics.Distributions.StudentT.InvCDF(0, 1, (299) + (43) - 2, .975) and 0.053326052716977074 = (383.0705720181414 - 362.6429305003794) / 383.0705720181414 is greater than 0.05. IsChangeEdgeDetector: Marked not as a regression because Edge Detector said so. ```### Baseline Jit Disasm ```assembly ; System.Collections.Tests.Perf_BitArray.BitArraySetLengthGrow() push ebp mov ebp,esp push edi push esi mov esi,ecx mov ecx,offset MT_System.Collections.BitArray call CORINFO_HELP_NEWSFAST mov edi,eax mov edx,[esi+0C] mov ecx,edi call dword ptr ds:[0A989030]; System.Collections.BitArray..ctor(Byte[]) mov edx,[edi+8] add edx,edx mov ecx,edi call dword ptr ds:[0A9891B0]; System.Collections.BitArray.set_Length(Int32) mov eax,edi pop esi pop edi pop ebp ret ; Total bytes of code 49 ``` ```assembly ; System.Collections.BitArray..ctor(Byte[]) push ebp mov ebp,esp push edi push esi push ebx sub esp,18 mov esi,ecx mov edi,edx M01_L00: test edi,edi je near ptr M01_L06 mov ebx,[edi+4] cmp ebx,0FFFFFFF jg near ptr M01_L07 mov edx,ebx add edx,3 shr edx,2 mov ecx,offset MT_System.Int32[] call CORINFO_HELP_NEWARR_1_VC lea edx,[esi+4] call CORINFO_HELP_ASSIGN_REF_EAX lea ecx,[ebx*8] mov [esi+8],ecx mov ecx,ebx shr ecx,2 mov [ebp-10],ecx add edi,8 xor edx,edx xor eax,eax mov [ebp-18],ecx mov [ebp-1C],eax cmp ecx,1 sbb eax,0 jl short M01_L04 M01_L01: mov [ebp-20],esi mov eax,[esi+4] mov [ebp-24],edi mov ecx,ebx cmp ecx,4 jl near ptr M01_L08 mov ecx,[ebp-24] mov ecx,[ecx] cmp edx,[eax+4] jae near ptr M01_L10 mov [eax+edx*4+8],ecx cmp ebx,4 jb near ptr M01_L09 add edi,4 add ebx,0FFFFFFFC inc edx mov ecx,edx mov eax,ecx sar eax,1F mov esi,[ebp-18] cmp ecx,esi mov ecx,[ebp-1C] sbb eax,ecx jl short M01_L03 M01_L02: xor ecx,ecx mov [ebp-14],ecx lea edx,[ebx-1] cmp edx,2 ja short M01_L05 lea eax,ds:[0B2B0B48] mov eax,[eax+edx*4] lea ecx,[M01_L00] add eax,ecx jmp eax M01_L03: mov esi,[ebp-20] jmp short M01_L01 M01_L04: mov [ebp-20],esi jmp short M01_L02 cmp ebx,2 jbe near ptr M01_L10 movzx ecx,byte ptr [edi+2] shl ecx,10 mov [ebp-14],ecx cmp ebx,1 jbe near ptr M01_L10 movzx edx,byte ptr [edi+1] shl edx,8 mov ecx,edx or ecx,[ebp-14] mov [ebp-14],ecx mov esi,[ebp-20] mov edx,[esi+4] test ebx,ebx je near ptr M01_L10 movzx eax,byte ptr [edi] or eax,[ebp-14] mov ecx,[ebp-10] cmp ecx,[edx+4] jae near ptr M01_L10 mov [edx+ecx*4+8],eax mov [ebp-20],esi M01_L05: xor edx,edx mov esi,[ebp-20] mov [esi+0C],edx lea esp,[ebp-0C] pop ebx pop esi pop edi pop ebp ret M01_L06: mov ecx,783 mov edx,0A803060 call CORINFO_HELP_STRCNS mov ecx,eax call dword ptr ds:[4F25AF8] int 3 M01_L07: mov ecx,offset MT_System.Int32 call CORINFO_HELP_NEWSFAST mov esi,eax call dword ptr ds:[0B29BB40] mov edi,eax mov dword ptr [esi+4],8 mov ecx,offset MT_System.ArgumentException call CORINFO_HELP_NEWSFAST mov ebx,eax mov edx,esi mov ecx,edi call dword ptr ds:[0B29B948] mov esi,eax mov ecx,783 mov edx,0A803060 call CORINFO_HELP_STRCNS push eax mov edx,esi mov ecx,ebx call dword ptr ds:[4E0BBA0] mov ecx,ebx call CORINFO_HELP_THROW M01_L08: mov ecx,29 call dword ptr ds:[8815528] int 3 M01_L09: call dword ptr ds:[88151E0] int 3 M01_L10: call CORINFO_HELP_RNGCHKFAIL int 3 ; Total bytes of code 447 ``` ```assembly ; System.Collections.BitArray.set_Length(Int32) push ebp mov ebp,esp push edi push esi push ebx push eax mov esi,ecx mov edi,edx test edi,edi jl near ptr M02_L05 lea ebx,[edi+1F] shr ebx,5 mov ecx,[esi+4] cmp [ecx+4],ebx jl short M02_L00 mov ecx,[esi+4] lea edx,[ebx+100] cmp [ecx+4],edx jle short M02_L01 M02_L00: lea ecx,[esi+4] mov edx,ebx call dword ptr ds:[0B29BFC0]; System.Array.Resize[[System.Int32, System.Private.CoreLib]](Int32[] ByRef, Int32) M02_L01: mov ecx,[esi+8] cmp edi,ecx jle short M02_L04 lea edx,[ecx-1] sar edx,5 mov [ebp-10],edx and ecx,1F jle short M02_L02 mov eax,[esi+4] cmp edx,[eax+4] jae short M02_L08 lea eax,[eax+edx*4+8] mov edx,1 shl edx,cl dec edx and [eax],edx mov edx,[ebp-10] M02_L02: mov ecx,[esi+4] lea eax,[edx+1] sub ebx,edx dec ebx test ecx,ecx je short M02_L06 cmp [ecx+4],eax jb short M02_L07 mov edx,[ecx+4] sub edx,eax cmp edx,ebx jb short M02_L07 lea ecx,[ecx+eax*4+8] mov edx,ebx M02_L03: shl edx,2 call dword ptr ds:[4E0F3A8]; System.SpanHelpers.ClearWithoutReferences(Byte ByRef, UIntPtr) M02_L04: mov [esi+8],edi inc dword ptr [esi+0C] pop ecx pop ebx pop esi pop edi pop ebp ret M02_L05: mov ecx,7A7 mov edx,0A803060 call CORINFO_HELP_STRCNS mov ecx,eax mov edx,edi call dword ptr ds:[4F15F60] int 3 M02_L06: or eax,ebx jne short M02_L07 xor ecx,ecx xor edx,edx jmp short M02_L03 M02_L07: call dword ptr ds:[88151E0] int 3 M02_L08: call CORINFO_HELP_RNGCHKFAIL int 3 ; Total bytes of code 207 ``` ### Compare Jit Disasm ```assembly ; System.Collections.Tests.Perf_BitArray.BitArraySetLengthGrow() push ebp mov ebp,esp push edi push esi mov esi,ecx mov ecx,offset MT_System.Collections.BitArray call CORINFO_HELP_NEWSFAST mov edi,eax mov edx,[esi+0C] mov ecx,edi call dword ptr ds:[0ADB9030]; System.Collections.BitArray..ctor(Byte[]) mov edx,[edi+8] add edx,edx mov ecx,edi call dword ptr ds:[0ADB91B0]; System.Collections.BitArray.set_Length(Int32) mov eax,edi pop esi pop edi pop ebp ret ; Total bytes of code 49 ``` ```assembly ; System.Collections.BitArray..ctor(Byte[]) push ebp mov ebp,esp push edi push esi push ebx sub esp,14 mov esi,ecx mov edi,edx M01_L00: test edi,edi je near ptr M01_L06 mov ebx,[edi+4] cmp ebx,0FFFFFFF jg near ptr M01_L07 mov edx,ebx add edx,3 shr edx,2 mov ecx,offset MT_System.Int32[] call CORINFO_HELP_NEWARR_1_VC lea edx,[esi+4] call CORINFO_HELP_ASSIGN_REF_EAX lea ecx,[ebx*8] mov [esi+8],ecx mov ecx,ebx shr ecx,2 mov [ebp-10],ecx add edi,8 xor edx,edx xor eax,eax mov [ebp-18],ecx mov [ebp-1C],eax cmp ecx,1 sbb eax,0 jl short M01_L04 M01_L01: mov [ebp-20],esi mov eax,[esi+4] mov ecx,edi cmp ebx,4 jl near ptr M01_L08 mov ecx,[ecx] cmp edx,[eax+4] jae near ptr M01_L10 mov [eax+edx*4+8],ecx cmp ebx,4 jb near ptr M01_L09 add edi,4 add ebx,0FFFFFFFC inc edx mov ecx,edx mov eax,ecx sar eax,1F mov esi,[ebp-18] cmp ecx,esi mov ecx,[ebp-1C] sbb eax,ecx jl short M01_L03 M01_L02: xor ecx,ecx mov [ebp-14],ecx lea edx,[ebx-1] cmp edx,2 ja short M01_L05 lea eax,ds:[0B6E0B40] mov eax,[eax+edx*4] lea ecx,[M01_L00] add eax,ecx jmp eax M01_L03: mov esi,[ebp-20] jmp short M01_L01 M01_L04: mov [ebp-20],esi jmp short M01_L02 cmp ebx,2 jbe near ptr M01_L10 movzx ecx,byte ptr [edi+2] shl ecx,10 mov [ebp-14],ecx cmp ebx,1 jbe near ptr M01_L10 movzx edx,byte ptr [edi+1] shl edx,8 mov ecx,edx or ecx,[ebp-14] mov [ebp-14],ecx mov esi,[ebp-20] mov edx,[esi+4] test ebx,ebx je near ptr M01_L10 movzx eax,byte ptr [edi] or eax,[ebp-14] mov ecx,[ebp-10] cmp ecx,[edx+4] jae near ptr M01_L10 mov [edx+ecx*4+8],eax mov [ebp-20],esi M01_L05: xor edx,edx mov esi,[ebp-20] mov [esi+0C],edx lea esp,[ebp-0C] pop ebx pop esi pop edi pop ebp ret M01_L06: mov ecx,783 mov edx,0AC53440 call CORINFO_HELP_STRCNS mov ecx,eax call dword ptr ds:[8BE5AF8] int 3 M01_L07: mov ecx,offset MT_System.Int32 call CORINFO_HELP_NEWSFAST mov esi,eax call dword ptr ds:[0B6CBB40] mov edi,eax mov dword ptr [esi+4],8 mov ecx,offset MT_System.ArgumentException call CORINFO_HELP_NEWSFAST mov ebx,eax mov edx,esi mov ecx,edi call dword ptr ds:[0B6CB948] mov esi,eax mov ecx,783 mov edx,0AC53440 call CORINFO_HELP_STRCNS push eax mov edx,esi mov ecx,ebx call dword ptr ds:[855BBA0] mov ecx,ebx call CORINFO_HELP_THROW M01_L08: mov ecx,29 call dword ptr ds:[8C455B8] int 3 M01_L09: call dword ptr ds:[8C45270] int 3 M01_L10: call CORINFO_HELP_RNGCHKFAIL int 3 ; Total bytes of code 441 ``` ```assembly ; System.Collections.BitArray.set_Length(Int32) push ebp mov ebp,esp push edi push esi push ebx push eax mov esi,ecx mov edi,edx test edi,edi jl near ptr M02_L05 lea ebx,[edi+1F] shr ebx,5 mov ecx,[esi+4] cmp [ecx+4],ebx jl short M02_L00 mov ecx,[esi+4] lea edx,[ebx+100] cmp [ecx+4],edx jle short M02_L01 M02_L00: lea ecx,[esi+4] mov edx,ebx call dword ptr ds:[0B6CBFC0]; System.Array.Resize[[System.Int32, System.Private.CoreLib]](Int32[] ByRef, Int32) M02_L01: mov ecx,[esi+8] cmp edi,ecx jle short M02_L04 lea edx,[ecx-1] sar edx,5 mov [ebp-10],edx and ecx,1F jle short M02_L02 mov eax,[esi+4] cmp edx,[eax+4] jae short M02_L08 lea eax,[eax+edx*4+8] mov edx,1 shl edx,cl dec edx and [eax],edx mov edx,[ebp-10] M02_L02: mov ecx,[esi+4] lea eax,[edx+1] sub ebx,edx dec ebx test ecx,ecx je short M02_L06 cmp [ecx+4],eax jb short M02_L07 mov edx,[ecx+4] sub edx,eax cmp edx,ebx jb short M02_L07 lea ecx,[ecx+eax*4+8] mov edx,ebx M02_L03: shl edx,2 call dword ptr ds:[855F390]; System.SpanHelpers.ClearWithoutReferences(Byte ByRef, UIntPtr) M02_L04: mov [esi+8],edi inc dword ptr [esi+0C] pop ecx pop ebx pop esi pop edi pop ebp ret M02_L05: mov ecx,7A7 mov edx,0AC53440 call CORINFO_HELP_STRCNS mov ecx,eax mov edx,edi call dword ptr ds:[8C05F60] int 3 M02_L06: or eax,ebx jne short M02_L07 xor ecx,ecx xor edx,edx jmp short M02_L03 M02_L07: call dword ptr ds:[8C45270] int 3 M02_L08: call CORINFO_HELP_RNGCHKFAIL int 3 ; Total bytes of code 207 ``` ### Docs [Profiling workflow for dotnet/runtime repository](https://github.com/dotnet/performance/blob/master/docs/profiling-workflow-dotnet-runtime.md) [Benchmarking workflow for dotnet/runtime repository](https://github.com/dotnet/performance/blob/master/docs/benchmarking-workflow-dotnet-runtime.md)
performanceautofiler[bot] commented 1 year ago

Run Information

Architecture x86
OS Windows 10.0.18362
Baseline 02682ad6397b2833660b104780a9d361f2cba6d7
Compare b5e79f56d1ed06dbf6765b29c021726ff4195e91
Diff Diff

Improvements in System.Text.Json.Document.Tests.Perf_EnumerateArray

Benchmark Baseline Test Test/Base Test Quality Edge Detector Baseline IR Compare IR IR Ratio Baseline ETL Compare ETL
[EnumerateUsingIndexer - Duration of single invocation](<https://pvscmdupload.z22.web.core.windows.net/reports/allTestHistory/refs/heads/main_x86_Windows 10.0.18362/System.Text.Json.Document.Tests.Perf_EnumerateArray.EnumerateUsingIndexer(TestCase%3a%20ArrayOfNumbers).html>) 1.69 μs 1.60 μs 0.94 0.02 False 20857.12455620219 19336.985495205452 0.9271165564121493 Trace Trace
[EnumerateUsingIndexer - Duration of single invocation](<https://pvscmdupload.z22.web.core.windows.net/reports/allTestHistory/refs/heads/main_x86_Windows 10.0.18362/System.Text.Json.Document.Tests.Perf_EnumerateArray.EnumerateUsingIndexer(TestCase%3a%20ArrayOfStrings).html>) 1.69 μs 1.59 μs 0.94 0.01 False 20854.83221722106 19328.416149068322 0.9268075594061942 Trace Trace

graph graph Test Report

Repro

git clone https://github.com/dotnet/performance.git
py .\performance\scripts\benchmarks_ci.py -f net8.0 --filter 'System.Text.Json.Document.Tests.Perf_EnumerateArray*'
### Payloads [Baseline]() [Compare]() ### Histogram #### System.Text.Json.Document.Tests.Perf_EnumerateArray.EnumerateUsingIndexer(TestCase: ArrayOfNumbers) ```log ``` ### Description of detection logic ```IsRegressionBase: Marked as not a regression because the compare was not 5% greater than the baseline, or the value was too small. IsImprovementBase: Marked as improvement because the compare was 5% less than the baseline, and the value was not too small. IsImprovementCheck: Marked as improvement because the three check build points were 0.05 less than the baseline. IsRegressionBase: Marked as not a regression because the compare was not 5% greater than the baseline, or the value was too small. IsImprovementBase: Marked as improvement because the compare was 5% less than the baseline, and the value was not too small. IsImprovementCheck: Marked as improvement because the three check build points were 0.05 less than the baseline. IsImprovementWindowed:Marked as improvement because 1.597512152175968 < 1.6069029443411023. IsChangePoint: Marked as a change because one of 1/30/2023 11:52:26 AM, 2/7/2023 8:22:47 AM falls between 1/29/2023 5:12:48 PM and 2/7/2023 8:22:47 AM. IsImprovementStdDev: Marked as improvement because 107.6594401614074 (T) = (0 -1599.078952912522) / Math.Sqrt((179.8179716876413 / (299)) + (7.7557995713204075 / (43))) is greater than 1.9669657340893643 = MathNet.Numerics.Distributions.StudentT.InvCDF(0, 1, (299) + (43) - 2, .975) and 0.056183400893691254 = (1694.2687323222278 - 1599.078952912522) / 1694.2687323222278 is greater than 0.05. IsChangeEdgeDetector: Marked not as a regression because Edge Detector said so. ```### Baseline Jit Disasm ```assembly ; System.Text.Json.Document.Tests.Perf_EnumerateArray.EnumerateUsingIndexer() push ebp mov ebp,esp push edi push esi push ebx sub esp,8 xor eax,eax mov [ebp-14],eax mov [ebp-10],eax lea esi,[ecx+10] mov edx,esi mov ecx,[edx] test ecx,ecx je short M00_L03 mov edx,[edx+4] cmp [ecx],ecx call dword ptr ds:[0B72F258]; System.Text.Json.JsonDocument.GetArrayLength(Int32) mov edi,eax xor ebx,ebx test edi,edi jle short M00_L01 M00_L00: mov ecx,esi mov edx,[ecx] test edx,edx je short M00_L02 push dword ptr [ecx+4] push ebx mov ecx,edx lea edx,[ebp-14] cmp [ecx],ecx call dword ptr ds:[0B72F270]; System.Text.Json.JsonDocument.GetArrayIndexElement(Int32, Int32) inc ebx cmp ebx,edi jl short M00_L00 M00_L01: lea esp,[ebp-0C] pop ebx pop esi pop edi pop ebp ret M00_L02: mov ecx,offset MT_System.InvalidOperationException call CORINFO_HELP_NEWSFAST mov esi,eax mov ecx,esi call dword ptr ds:[8C4FCC0] mov ecx,esi call CORINFO_HELP_THROW M00_L03: mov ecx,offset MT_System.InvalidOperationException call CORINFO_HELP_NEWSFAST mov esi,eax mov ecx,esi call dword ptr ds:[8C4FCC0] mov ecx,esi call CORINFO_HELP_THROW int 3 ; Total bytes of code 140 ``` ```assembly ; System.Text.Json.JsonDocument.GetArrayLength(Int32) push ebp mov ebp,esp cmp dword ptr [ecx+18],0 je short M01_L01 mov eax,[ecx+1C] test eax,eax je short M01_L02 cmp [eax+4],edx jb short M01_L03 lea ecx,[eax+edx+8] mov eax,[eax+4] sub eax,edx M01_L00: cmp eax,0C jl short M01_L04 cmp [ecx],ecx mov eax,[ecx+4] mov edx,[ecx+8] shr edx,1C movzx edx,dl cmp edx,3 jne short M01_L05 and eax,7FFFFFFF pop ebp ret M01_L01: call dword ptr ds:[0B9FB6A8] int 3 M01_L02: test edx,edx jne short M01_L03 xor ecx,ecx xor eax,eax jmp short M01_L00 M01_L03: call dword ptr ds:[8CA51E0] int 3 M01_L04: mov ecx,29 call dword ptr ds:[8CA5528] int 3 M01_L05: mov ecx,3 call dword ptr ds:[0B9FB450] int 3 ; Total bytes of code 109 ``` ```assembly ; System.Text.Json.JsonDocument.GetArrayIndexElement(Int32, Int32) push ebp mov ebp,esp push edi push esi push ebx sub esp,10 mov eax,edx mov esi,[ebp+0C] mov edx,[ebp+8] cmp dword ptr [ecx+18],0 je near ptr M02_L08 mov edi,[ecx+1C] mov ebx,edi test ebx,ebx je near ptr M02_L09 cmp [ebx+4],esi jb near ptr M02_L06 mov [ebp+0C],esi lea esi,[ebx+esi+8] mov ebx,[ebx+4] sub ebx,[ebp+0C] M02_L00: cmp ebx,0C jl near ptr M02_L07 cmp [esi],esi mov ebx,[esi+4] mov [ebp-10],ebx mov esi,[esi+8] mov ebx,esi shr ebx,1C movzx ebx,bl cmp ebx,3 jne near ptr M02_L10 mov ebx,[ebp-10] mov esi,ebx and esi,7FFFFFFF cmp edx,esi jae near ptr M02_L11 test ebx,ebx jl short M02_L01 inc edx lea edx,[edx+edx*2] mov esi,[ebp+0C] lea esi,[esi+edx*4] mov edx,eax call CORINFO_HELP_CHECKED_ASSIGN_REF_ECX mov [eax+4],esi lea esp,[ebp-0C] pop ebx pop esi pop edi pop ebp ret 8 M02_L01: mov [ebp-1C],eax xor esi,esi mov ebx,[ebp+0C] add ebx,0C mov [ebp-18],ecx mov eax,[ecx+20] mov [ebp-14],eax cmp ebx,eax jge near ptr M02_L13 M02_L02: cmp edx,esi je short M02_L05 mov eax,edi test eax,eax je near ptr M02_L12 cmp [eax+4],ebx jb short M02_L06 lea ecx,[eax+ebx+8] mov eax,[eax+4] sub eax,ebx M02_L03: cmp eax,0C jl short M02_L07 cmp [ecx],ecx mov eax,[ecx+8] mov ecx,eax shr ecx,1C movzx ecx,cl cmp ecx,5 jge short M02_L04 and eax,0FFFFFFF lea eax,[eax+eax*2] lea ebx,[ebx+eax*4] M02_L04: inc esi add ebx,0C mov eax,[ebp-14] cmp ebx,eax jge near ptr M02_L13 jmp short M02_L02 M02_L05: mov eax,ebx mov edx,[ebp-1C] mov ecx,[ebp-18] call CORINFO_HELP_CHECKED_ASSIGN_REF_ECX mov edx,[ebp-1C] mov [edx+4],eax lea esp,[ebp-0C] pop ebx pop esi pop edi pop ebp ret 8 M02_L06: call dword ptr ds:[8CA51E0] int 3 M02_L07: mov ecx,29 call dword ptr ds:[8CA5528] int 3 M02_L08: call dword ptr ds:[0B9FB6A8] int 3 M02_L09: mov [ebp+0C],esi test esi,esi jne short M02_L06 xor ebx,ebx xor esi,esi xchg ebx,esi jmp near ptr M02_L00 M02_L10: mov edx,ebx mov ecx,3 call dword ptr ds:[0B9FB450] int 3 M02_L11: mov ecx,offset MT_System.IndexOutOfRangeException call CORINFO_HELP_NEWSFAST mov edi,eax mov ecx,edi call dword ptr ds:[8BE5CD8] mov ecx,edi call CORINFO_HELP_THROW M02_L12: test ebx,ebx jne short M02_L06 xor eax,eax xor ecx,ecx xchg eax,ecx jmp near ptr M02_L03 M02_L13: mov ecx,offset MT_System.IndexOutOfRangeException call CORINFO_HELP_NEWSFAST mov esi,eax mov ecx,esi call dword ptr ds:[8BE5CD8] mov ecx,esi call CORINFO_HELP_THROW int 3 ; Total bytes of code 416 ``` ### Compare Jit Disasm ```assembly ; System.Text.Json.Document.Tests.Perf_EnumerateArray.EnumerateUsingIndexer() push ebp mov ebp,esp push edi push esi push ebx sub esp,8 xor eax,eax mov [ebp-14],eax mov [ebp-10],eax lea esi,[ecx+10] mov edx,esi mov ecx,[edx] test ecx,ecx je short M00_L03 mov edx,[edx+4] cmp [ecx],ecx call dword ptr ds:[0B4FF258]; System.Text.Json.JsonDocument.GetArrayLength(Int32) mov edi,eax xor ebx,ebx test edi,edi jle short M00_L01 M00_L00: mov ecx,esi mov edx,[ecx] test edx,edx je short M00_L02 push dword ptr [ecx+4] push ebx mov ecx,edx lea edx,[ebp-14] cmp [ecx],ecx call dword ptr ds:[0B4FF270]; System.Text.Json.JsonDocument.GetArrayIndexElement(Int32, Int32) inc ebx cmp ebx,edi jl short M00_L00 M00_L01: lea esp,[ebp-0C] pop ebx pop esi pop edi pop ebp ret M00_L02: mov ecx,offset MT_System.InvalidOperationException call CORINFO_HELP_NEWSFAST mov esi,eax mov ecx,esi call dword ptr ds:[8A1FCC0] mov ecx,esi call CORINFO_HELP_THROW M00_L03: mov ecx,offset MT_System.InvalidOperationException call CORINFO_HELP_NEWSFAST mov esi,eax mov ecx,esi call dword ptr ds:[8A1FCC0] mov ecx,esi call CORINFO_HELP_THROW int 3 ; Total bytes of code 140 ``` ```assembly ; System.Text.Json.JsonDocument.GetArrayLength(Int32) push ebp mov ebp,esp cmp dword ptr [ecx+18],0 je short M01_L01 mov eax,[ecx+1C] test eax,eax je short M01_L02 mov ecx,[eax+4] cmp ecx,edx jb short M01_L03 lea eax,[eax+edx+8] sub ecx,edx M01_L00: cmp ecx,0C jl short M01_L04 mov edx,[eax+4] mov eax,[eax+8] shr eax,1C movzx eax,al cmp eax,3 jne short M01_L05 mov eax,edx and eax,7FFFFFFF pop ebp ret M01_L01: call dword ptr ds:[0B7CB6A8] int 3 M01_L02: test edx,edx jne short M01_L03 xor eax,eax xor ecx,ecx jmp short M01_L00 M01_L03: call dword ptr ds:[8A75270] int 3 M01_L04: mov ecx,29 call dword ptr ds:[8A755B8] int 3 M01_L05: mov edx,eax mov ecx,3 call dword ptr ds:[0B7CB450] int 3 ; Total bytes of code 110 ``` ```assembly ; System.Text.Json.JsonDocument.GetArrayIndexElement(Int32, Int32) push ebp mov ebp,esp push edi push esi push ebx sub esp,0C mov [ebp-18],edx mov edx,[ebp+8] cmp dword ptr [ecx+18],0 je near ptr M02_L08 mov edi,[ecx+1C] mov ebx,edi test ebx,ebx je near ptr M02_L09 mov esi,[ebx+4] mov eax,[ebp+0C] cmp esi,eax jb near ptr M02_L06 lea ebx,[ebx+eax+8] sub esi,eax M02_L00: cmp esi,0C jl near ptr M02_L07 mov esi,[ebx+4] mov ebx,[ebx+8] shr ebx,1C movzx ebx,bl cmp ebx,3 jne near ptr M02_L10 mov ebx,esi and ebx,7FFFFFFF cmp edx,ebx jae near ptr M02_L11 test esi,esi jl short M02_L01 inc edx lea edx,[edx+edx*2] lea eax,[eax+edx*4] mov edx,[ebp-18] call CORINFO_HELP_CHECKED_ASSIGN_REF_ECX mov edx,[ebp-18] mov [edx+4],eax lea esp,[ebp-0C] pop ebx pop esi pop edi pop ebp ret 8 M02_L01: xor esi,esi add eax,0C mov [ebp-14],ecx mov ebx,[ecx+20] mov [ebp-10],ebx cmp eax,ebx jge near ptr M02_L13 M02_L02: cmp edx,esi je short M02_L05 mov ebx,edi test ebx,ebx je near ptr M02_L12 mov ecx,[ebx+4] cmp ecx,eax jb short M02_L06 lea ebx,[ebx+eax+8] sub ecx,eax M02_L03: cmp ecx,0C jl short M02_L07 mov ebx,[ebx+8] mov ecx,ebx shr ecx,1C movzx ecx,cl cmp ecx,5 jge short M02_L04 mov ecx,ebx and ecx,0FFFFFFF lea ecx,[ecx+ecx*2] lea eax,[eax+ecx*4] M02_L04: inc esi add eax,0C mov ebx,[ebp-10] cmp eax,ebx jge near ptr M02_L13 jmp short M02_L02 M02_L05: mov edx,[ebp-18] mov ecx,[ebp-14] call CORINFO_HELP_CHECKED_ASSIGN_REF_ECX mov edx,[ebp-18] mov [edx+4],eax lea esp,[ebp-0C] pop ebx pop esi pop edi pop ebp ret 8 M02_L06: call dword ptr ds:[8A75270] int 3 M02_L07: mov ecx,29 call dword ptr ds:[8A755B8] int 3 M02_L08: call dword ptr ds:[0B7CB6A8] int 3 M02_L09: cmp dword ptr [ebp+0C],0 jne short M02_L06 xor ebx,ebx xor esi,esi mov eax,[ebp+0C] jmp near ptr M02_L00 M02_L10: mov edx,ebx mov ecx,3 call dword ptr ds:[0B7CB450] int 3 M02_L11: mov ecx,offset MT_System.IndexOutOfRangeException call CORINFO_HELP_NEWSFAST mov edi,eax mov ecx,edi call dword ptr ds:[89B72A0] mov ecx,edi call CORINFO_HELP_THROW M02_L12: test eax,eax jne short M02_L06 xor ebx,ebx xor ecx,ecx jmp near ptr M02_L03 M02_L13: mov ecx,offset MT_System.IndexOutOfRangeException call CORINFO_HELP_NEWSFAST mov esi,eax mov ecx,esi call dword ptr ds:[89B72A0] mov ecx,esi call CORINFO_HELP_THROW int 3 ; Total bytes of code 393 ``` #### System.Text.Json.Document.Tests.Perf_EnumerateArray.EnumerateUsingIndexer(TestCase: ArrayOfStrings) ```log ``` ### Description of detection logic ```IsRegressionBase: Marked as not a regression because the compare was not 5% greater than the baseline, or the value was too small. IsImprovementBase: Marked as improvement because the compare was 5% less than the baseline, and the value was not too small. IsImprovementCheck: Marked as improvement because the three check build points were 0.05 less than the baseline. IsRegressionBase: Marked as not a regression because the compare was not 5% greater than the baseline, or the value was too small. IsImprovementBase: Marked as improvement because the compare was 5% less than the baseline, and the value was not too small. IsImprovementCheck: Marked as improvement because the three check build points were 0.05 less than the baseline. IsImprovementWindowed:Marked as improvement because 1.5941396269800716 < 1.6063556858505974. IsChangePoint: Marked as a change because one of 1/30/2023 11:52:26 AM, 2/7/2023 8:22:47 AM falls between 1/29/2023 5:12:48 PM and 2/7/2023 8:22:47 AM. IsImprovementStdDev: Marked as improvement because 116.17156068536974 (T) = (0 -1598.9156275853456) / Math.Sqrt((122.56779063088793 / (299)) + (11.594013804219587 / (43))) is greater than 1.9669657340893643 = MathNet.Numerics.Distributions.StudentT.InvCDF(0, 1, (299) + (43) - 2, .975) and 0.056509784064627124 = (1694.6817259786699 - 1598.9156275853456) / 1694.6817259786699 is greater than 0.05. IsChangeEdgeDetector: Marked not as a regression because Edge Detector said so. ```### Baseline Jit Disasm ```assembly ; System.Text.Json.Document.Tests.Perf_EnumerateArray.EnumerateUsingIndexer() push ebp mov ebp,esp push edi push esi push ebx sub esp,8 xor eax,eax mov [ebp-14],eax mov [ebp-10],eax lea esi,[ecx+10] mov edx,esi mov ecx,[edx] test ecx,ecx je short M00_L03 mov edx,[edx+4] cmp [ecx],ecx call dword ptr ds:[0BA7F258]; System.Text.Json.JsonDocument.GetArrayLength(Int32) mov edi,eax xor ebx,ebx test edi,edi jle short M00_L01 M00_L00: mov ecx,esi mov edx,[ecx] test edx,edx je short M00_L02 push dword ptr [ecx+4] push ebx mov ecx,edx lea edx,[ebp-14] cmp [ecx],ecx call dword ptr ds:[0BA7F270]; System.Text.Json.JsonDocument.GetArrayIndexElement(Int32, Int32) inc ebx cmp ebx,edi jl short M00_L00 M00_L01: lea esp,[ebp-0C] pop ebx pop esi pop edi pop ebp ret M00_L02: mov ecx,offset MT_System.InvalidOperationException call CORINFO_HELP_NEWSFAST mov esi,eax mov ecx,esi call dword ptr ds:[8F9FCC0] mov ecx,esi call CORINFO_HELP_THROW M00_L03: mov ecx,offset MT_System.InvalidOperationException call CORINFO_HELP_NEWSFAST mov esi,eax mov ecx,esi call dword ptr ds:[8F9FCC0] mov ecx,esi call CORINFO_HELP_THROW int 3 ; Total bytes of code 140 ``` ```assembly ; System.Text.Json.JsonDocument.GetArrayLength(Int32) push ebp mov ebp,esp cmp dword ptr [ecx+18],0 je short M01_L01 mov eax,[ecx+1C] test eax,eax je short M01_L02 cmp [eax+4],edx jb short M01_L03 lea ecx,[eax+edx+8] mov eax,[eax+4] sub eax,edx M01_L00: cmp eax,0C jl short M01_L04 cmp [ecx],ecx mov eax,[ecx+4] mov edx,[ecx+8] shr edx,1C movzx edx,dl cmp edx,3 jne short M01_L05 and eax,7FFFFFFF pop ebp ret M01_L01: call dword ptr ds:[0BD4BF60] int 3 M01_L02: test edx,edx jne short M01_L03 xor ecx,ecx xor eax,eax jmp short M01_L00 M01_L03: call dword ptr ds:[8FF51E0] int 3 M01_L04: mov ecx,29 call dword ptr ds:[8FF5528] int 3 M01_L05: mov ecx,3 call dword ptr ds:[0BD4BD08] int 3 ; Total bytes of code 109 ``` ```assembly ; System.Text.Json.JsonDocument.GetArrayIndexElement(Int32, Int32) push ebp mov ebp,esp push edi push esi push ebx sub esp,10 mov eax,edx mov esi,[ebp+0C] mov edx,[ebp+8] cmp dword ptr [ecx+18],0 je near ptr M02_L08 mov edi,[ecx+1C] mov ebx,edi test ebx,ebx je near ptr M02_L09 cmp [ebx+4],esi jb near ptr M02_L06 mov [ebp+0C],esi lea esi,[ebx+esi+8] mov ebx,[ebx+4] sub ebx,[ebp+0C] M02_L00: cmp ebx,0C jl near ptr M02_L07 cmp [esi],esi mov ebx,[esi+4] mov [ebp-10],ebx mov esi,[esi+8] mov ebx,esi shr ebx,1C movzx ebx,bl cmp ebx,3 jne near ptr M02_L10 mov ebx,[ebp-10] mov esi,ebx and esi,7FFFFFFF cmp edx,esi jae near ptr M02_L11 test ebx,ebx jl short M02_L01 inc edx lea edx,[edx+edx*2] mov esi,[ebp+0C] lea esi,[esi+edx*4] mov edx,eax call CORINFO_HELP_CHECKED_ASSIGN_REF_ECX mov [eax+4],esi lea esp,[ebp-0C] pop ebx pop esi pop edi pop ebp ret 8 M02_L01: mov [ebp-1C],eax xor esi,esi mov ebx,[ebp+0C] add ebx,0C mov [ebp-18],ecx mov eax,[ecx+20] mov [ebp-14],eax cmp ebx,eax jge near ptr M02_L13 M02_L02: cmp edx,esi je short M02_L05 mov eax,edi test eax,eax je near ptr M02_L12 cmp [eax+4],ebx jb short M02_L06 lea ecx,[eax+ebx+8] mov eax,[eax+4] sub eax,ebx M02_L03: cmp eax,0C jl short M02_L07 cmp [ecx],ecx mov eax,[ecx+8] mov ecx,eax shr ecx,1C movzx ecx,cl cmp ecx,5 jge short M02_L04 and eax,0FFFFFFF lea eax,[eax+eax*2] lea ebx,[ebx+eax*4] M02_L04: inc esi add ebx,0C mov eax,[ebp-14] cmp ebx,eax jge near ptr M02_L13 jmp short M02_L02 M02_L05: mov eax,ebx mov edx,[ebp-1C] mov ecx,[ebp-18] call CORINFO_HELP_CHECKED_ASSIGN_REF_ECX mov edx,[ebp-1C] mov [edx+4],eax lea esp,[ebp-0C] pop ebx pop esi pop edi pop ebp ret 8 M02_L06: call dword ptr ds:[8FF51E0] int 3 M02_L07: mov ecx,29 call dword ptr ds:[8FF5528] int 3 M02_L08: call dword ptr ds:[0BD4BF60] int 3 M02_L09: mov [ebp+0C],esi test esi,esi jne short M02_L06 xor ebx,ebx xor esi,esi xchg ebx,esi jmp near ptr M02_L00 M02_L10: mov edx,ebx mov ecx,3 call dword ptr ds:[0BD4BD08] int 3 M02_L11: mov ecx,offset MT_System.IndexOutOfRangeException call CORINFO_HELP_NEWSFAST mov edi,eax mov ecx,edi call dword ptr ds:[8F35CD8] mov ecx,edi call CORINFO_HELP_THROW M02_L12: test ebx,ebx jne short M02_L06 xor eax,eax xor ecx,ecx xchg eax,ecx jmp near ptr M02_L03 M02_L13: mov ecx,offset MT_System.IndexOutOfRangeException call CORINFO_HELP_NEWSFAST mov esi,eax mov ecx,esi call dword ptr ds:[8F35CD8] mov ecx,esi call CORINFO_HELP_THROW int 3 ; Total bytes of code 416 ``` ### Compare Jit Disasm ```assembly ; System.Text.Json.Document.Tests.Perf_EnumerateArray.EnumerateUsingIndexer() push ebp mov ebp,esp push edi push esi push ebx sub esp,8 xor eax,eax mov [ebp-14],eax mov [ebp-10],eax lea esi,[ecx+10] mov edx,esi mov ecx,[edx] test ecx,ecx je short M00_L03 mov edx,[edx+4] cmp [ecx],ecx call dword ptr ds:[0AD7F258]; System.Text.Json.JsonDocument.GetArrayLength(Int32) mov edi,eax xor ebx,ebx test edi,edi jle short M00_L01 M00_L00: mov ecx,esi mov edx,[ecx] test edx,edx je short M00_L02 push dword ptr [ecx+4] push ebx mov ecx,edx lea edx,[ebp-14] cmp [ecx],ecx call dword ptr ds:[0AD7F270]; System.Text.Json.JsonDocument.GetArrayIndexElement(Int32, Int32) inc ebx cmp ebx,edi jl short M00_L00 M00_L01: lea esp,[ebp-0C] pop ebx pop esi pop edi pop ebp ret M00_L02: mov ecx,offset MT_System.InvalidOperationException call CORINFO_HELP_NEWSFAST mov esi,eax mov ecx,esi call dword ptr ds:[829FCC0] mov ecx,esi call CORINFO_HELP_THROW M00_L03: mov ecx,offset MT_System.InvalidOperationException call CORINFO_HELP_NEWSFAST mov esi,eax mov ecx,esi call dword ptr ds:[829FCC0] mov ecx,esi call CORINFO_HELP_THROW int 3 ; Total bytes of code 140 ``` ```assembly ; System.Text.Json.JsonDocument.GetArrayLength(Int32) push ebp mov ebp,esp cmp dword ptr [ecx+18],0 je short M01_L01 mov eax,[ecx+1C] test eax,eax je short M01_L02 mov ecx,[eax+4] cmp ecx,edx jb short M01_L03 lea eax,[eax+edx+8] sub ecx,edx M01_L00: cmp ecx,0C jl short M01_L04 mov edx,[eax+4] mov eax,[eax+8] shr eax,1C movzx eax,al cmp eax,3 jne short M01_L05 mov eax,edx and eax,7FFFFFFF pop ebp ret M01_L01: call dword ptr ds:[0B04BF60] int 3 M01_L02: test edx,edx jne short M01_L03 xor eax,eax xor ecx,ecx jmp short M01_L00 M01_L03: call dword ptr ds:[82F5270] int 3 M01_L04: mov ecx,29 call dword ptr ds:[82F55B8] int 3 M01_L05: mov edx,eax mov ecx,3 call dword ptr ds:[0B04BD08] int 3 ; Total bytes of code 110 ``` ```assembly ; System.Text.Json.JsonDocument.GetArrayIndexElement(Int32, Int32) push ebp mov ebp,esp push edi push esi push ebx sub esp,0C mov [ebp-18],edx mov edx,[ebp+8] cmp dword ptr [ecx+18],0 je near ptr M02_L08 mov edi,[ecx+1C] mov ebx,edi test ebx,ebx je near ptr M02_L09 mov esi,[ebx+4] mov eax,[ebp+0C] cmp esi,eax jb near ptr M02_L06 lea ebx,[ebx+eax+8] sub esi,eax M02_L00: cmp esi,0C jl near ptr M02_L07 mov esi,[ebx+4] mov ebx,[ebx+8] shr ebx,1C movzx ebx,bl cmp ebx,3 jne near ptr M02_L10 mov ebx,esi and ebx,7FFFFFFF cmp edx,ebx jae near ptr M02_L11 test esi,esi jl short M02_L01 inc edx lea edx,[edx+edx*2] lea eax,[eax+edx*4] mov edx,[ebp-18] call CORINFO_HELP_CHECKED_ASSIGN_REF_ECX mov edx,[ebp-18] mov [edx+4],eax lea esp,[ebp-0C] pop ebx pop esi pop edi pop ebp ret 8 M02_L01: xor esi,esi add eax,0C mov [ebp-14],ecx mov ebx,[ecx+20] mov [ebp-10],ebx cmp eax,ebx jge near ptr M02_L13 M02_L02: cmp edx,esi je short M02_L05 mov ebx,edi test ebx,ebx je near ptr M02_L12 mov ecx,[ebx+4] cmp ecx,eax jb short M02_L06 lea ebx,[ebx+eax+8] sub ecx,eax M02_L03: cmp ecx,0C jl short M02_L07 mov ebx,[ebx+8] mov ecx,ebx shr ecx,1C movzx ecx,cl cmp ecx,5 jge short M02_L04 mov ecx,ebx and ecx,0FFFFFFF lea ecx,[ecx+ecx*2] lea eax,[eax+ecx*4] M02_L04: inc esi add eax,0C mov ebx,[ebp-10] cmp eax,ebx jge near ptr M02_L13 jmp short M02_L02 M02_L05: mov edx,[ebp-18] mov ecx,[ebp-14] call CORINFO_HELP_CHECKED_ASSIGN_REF_ECX mov edx,[ebp-18] mov [edx+4],eax lea esp,[ebp-0C] pop ebx pop esi pop edi pop ebp ret 8 M02_L06: call dword ptr ds:[82F5270] int 3 M02_L07: mov ecx,29 call dword ptr ds:[82F55B8] int 3 M02_L08: call dword ptr ds:[0B04BF60] int 3 M02_L09: cmp dword ptr [ebp+0C],0 jne short M02_L06 xor ebx,ebx xor esi,esi mov eax,[ebp+0C] jmp near ptr M02_L00 M02_L10: mov edx,ebx mov ecx,3 call dword ptr ds:[0B04BD08] int 3 M02_L11: mov ecx,offset MT_System.IndexOutOfRangeException call CORINFO_HELP_NEWSFAST mov edi,eax mov ecx,edi call dword ptr ds:[82372A0] mov ecx,edi call CORINFO_HELP_THROW M02_L12: test eax,eax jne short M02_L06 xor ebx,ebx xor ecx,ecx jmp near ptr M02_L03 M02_L13: mov ecx,offset MT_System.IndexOutOfRangeException call CORINFO_HELP_NEWSFAST mov esi,eax mov ecx,esi call dword ptr ds:[82372A0] mov ecx,esi call CORINFO_HELP_THROW int 3 ; Total bytes of code 393 ``` ### Docs [Profiling workflow for dotnet/runtime repository](https://github.com/dotnet/performance/blob/master/docs/profiling-workflow-dotnet-runtime.md) [Benchmarking workflow for dotnet/runtime repository](https://github.com/dotnet/performance/blob/master/docs/benchmarking-workflow-dotnet-runtime.md)