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 #12751

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.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 20856.664470794905 19334.008938779752 0.9269942931599973 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 20855.747063343944 19348.38130737903 0.9277242022840668 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:[0BAAF258]; 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:[0BAAF270]; 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:[8FCFCC0] 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:[8FCFCC0] 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:[0BD7B6A8] 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:[90251E0] int 3 M01_L04: mov ecx,29 call dword ptr ds:[9025528] int 3 M01_L05: mov ecx,3 call dword ptr ds:[0BD7B450] 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:[90251E0] int 3 M02_L07: mov ecx,29 call dword ptr ds:[9025528] int 3 M02_L08: call dword ptr ds:[0BD7B6A8] 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:[0BD7B450] int 3 M02_L11: mov ecx,offset MT_System.IndexOutOfRangeException call CORINFO_HELP_NEWSFAST mov edi,eax mov ecx,edi call dword ptr ds:[8F65CD8] 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:[8F65CD8] 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:[0B38F258]; 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:[0B38F270]; 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:[883FCC0] 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:[883FCC0] 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:[0B65B6A8] 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:[8895270] int 3 M01_L04: mov ecx,29 call dword ptr ds:[88955B8] int 3 M01_L05: mov edx,eax mov ecx,3 call dword ptr ds:[0B65B450] 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:[8895270] int 3 M02_L07: mov ecx,29 call dword ptr ds:[88955B8] int 3 M02_L08: call dword ptr ds:[0B65B6A8] 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:[0B65B450] int 3 M02_L11: mov ecx,offset MT_System.IndexOutOfRangeException call CORINFO_HELP_NEWSFAST mov edi,eax mov ecx,edi call dword ptr ds:[87D72A0] 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:[87D72A0] 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:[0B3DF258]; 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:[0B3DF270]; 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:[88FFCC0] 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:[88FFCC0] 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:[0B6ABF60] 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:[89551E0] int 3 M01_L04: mov ecx,29 call dword ptr ds:[8955528] int 3 M01_L05: mov ecx,3 call dword ptr ds:[0B6ABD08] 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:[89551E0] int 3 M02_L07: mov ecx,29 call dword ptr ds:[8955528] int 3 M02_L08: call dword ptr ds:[0B6ABF60] 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:[0B6ABD08] int 3 M02_L11: mov ecx,offset MT_System.IndexOutOfRangeException call CORINFO_HELP_NEWSFAST mov edi,eax mov ecx,edi call dword ptr ds:[8895CD8] 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:[8895CD8] 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:[0B58F258]; 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:[0B58F270]; 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:[8A3FCC0] 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:[8A3FCC0] 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:[0B85BF60] 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:[8A95270] int 3 M01_L04: mov ecx,29 call dword ptr ds:[8A955B8] int 3 M01_L05: mov edx,eax mov ecx,3 call dword ptr ds:[0B85BD08] 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:[8A95270] int 3 M02_L07: mov ecx,29 call dword ptr ds:[8A955B8] int 3 M02_L08: call dword ptr ds:[0B85BF60] 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:[0B85BD08] int 3 M02_L11: mov ecx,offset MT_System.IndexOutOfRangeException call CORINFO_HELP_NEWSFAST mov edi,eax mov ecx,edi call dword ptr ds:[89D72A0] 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:[89D72A0] 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)
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 3592.4750679963736 3329.5891211991025 0.9268231673646965 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 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 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:[0A9B9030]; 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:[0A9B91B0]; 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:[0B2F0B48] 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,0A833060 call CORINFO_HELP_STRCNS mov ecx,eax call dword ptr ds:[87E5AF8] int 3 M01_L07: mov ecx,offset MT_System.Int32 call CORINFO_HELP_NEWSFAST mov esi,eax call dword ptr ds:[0B2CBB40] 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:[0B2CB948] mov esi,eax mov ecx,783 mov edx,0A833060 call CORINFO_HELP_STRCNS push eax mov edx,esi mov ecx,ebx call dword ptr ds:[815BBA0] mov ecx,ebx call CORINFO_HELP_THROW M01_L08: mov ecx,29 call dword ptr ds:[8845528] int 3 M01_L09: call dword ptr ds:[88451E0] 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:[0B2CBFC0] 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:[815F3A8]; 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,0A833060 call CORINFO_HELP_STRCNS mov ecx,eax mov edx,edi call dword ptr ds:[87D5F60] 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:[88451E0] 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:[0AE59030]; 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:[0AE591B0]; 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:[0B780B40] 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,0ACF3440 call CORINFO_HELP_STRCNS mov ecx,eax call dword ptr ds:[8C85AF8] int 3 M01_L07: mov ecx,offset MT_System.Int32 call CORINFO_HELP_NEWSFAST mov esi,eax call dword ptr ds:[0B76BB40] 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:[0B76B948] mov esi,eax mov ecx,783 mov edx,0ACF3440 call CORINFO_HELP_STRCNS push eax mov edx,esi mov ecx,ebx call dword ptr ds:[85FBBA0] mov ecx,ebx call CORINFO_HELP_THROW M01_L08: mov ecx,29 call dword ptr ds:[8CE55B8] int 3 M01_L09: call dword ptr ds:[8CE5270] 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:[0B76BFC0] 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:[85FF390]; 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,0ACF3440 call CORINFO_HELP_STRCNS mov ecx,eax mov edx,edi call dword ptr ds:[8CA5F60] 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:[8CE5270] 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:[0AE89030]; 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:[0B7B0B28] 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,0AD03060 call CORINFO_HELP_STRCNS mov ecx,eax call dword ptr ds:[8C45AF8] int 3 M01_L07: mov ecx,offset MT_System.Int32 call CORINFO_HELP_NEWSFAST mov esi,eax call dword ptr ds:[0B79BB40] 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:[0B79B948] mov esi,eax mov ecx,783 mov edx,0AD03060 call CORINFO_HELP_STRCNS push eax mov edx,esi mov ecx,ebx call dword ptr ds:[85BBBA0] mov ecx,ebx call CORINFO_HELP_THROW M01_L08: mov ecx,29 call dword ptr ds:[8CA5528] int 3 M01_L09: call dword ptr ds:[8CA51E0] 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:[0A909030]; 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:[0B230B20] 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,0A7A3440 call CORINFO_HELP_STRCNS mov ecx,eax call dword ptr ds:[8735AF8] int 3 M01_L07: mov ecx,offset MT_System.Int32 call CORINFO_HELP_NEWSFAST mov esi,eax call dword ptr ds:[0B21BB40] 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:[0B21B948] mov esi,eax mov ecx,783 mov edx,0A7A3440 call CORINFO_HELP_STRCNS push eax mov edx,esi mov ecx,ebx call dword ptr ds:[80ABBA0] mov ecx,ebx call CORINFO_HELP_THROW M01_L08: mov ecx,29 call dword ptr ds:[87955B8] int 3 M01_L09: call dword ptr ds:[8795270] 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:[0B099030]; System.Collections.BitArray..ctor(Byte[]) mov edx,[edi+8] add edx,edx mov ecx,edi call dword ptr ds:[0B0991B0]; 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:[0B9C0B48] 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,0AF13060 call CORINFO_HELP_STRCNS mov ecx,eax call dword ptr ds:[8EC5AF8] int 3 M01_L07: mov ecx,offset MT_System.Int32 call CORINFO_HELP_NEWSFAST mov esi,eax call dword ptr ds:[0B9ABB40] 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:[0B9AB948] mov esi,eax mov ecx,783 mov edx,0AF13060 call CORINFO_HELP_STRCNS push eax mov edx,esi mov ecx,ebx call dword ptr ds:[883BBA0] mov ecx,ebx call CORINFO_HELP_THROW M01_L08: mov ecx,29 call dword ptr ds:[8F25528] int 3 M01_L09: call dword ptr ds:[8F251E0] 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:[0B9ABFC0]; 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:[883F3A8]; 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,0AF13060 call CORINFO_HELP_STRCNS mov ecx,eax mov edx,edi call dword ptr ds:[8EB5F60] 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:[8F251E0] 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:[0A699030]; System.Collections.BitArray..ctor(Byte[]) mov edx,[edi+8] add edx,edx mov ecx,edi call dword ptr ds:[0A6991B0]; 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:[0AFC0B40] 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,0A533440 call CORINFO_HELP_STRCNS mov ecx,eax call dword ptr ds:[8455AF8] int 3 M01_L07: mov ecx,offset MT_System.Int32 call CORINFO_HELP_NEWSFAST mov esi,eax call dword ptr ds:[0AFABB40] 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:[0AFAB948] mov esi,eax mov ecx,783 mov edx,0A533440 call CORINFO_HELP_STRCNS push eax mov edx,esi mov ecx,ebx call dword ptr ds:[4C3BBA0] mov ecx,ebx call CORINFO_HELP_THROW M01_L08: mov ecx,29 call dword ptr ds:[84B55B8] int 3 M01_L09: call dword ptr ds:[84B5270] 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:[0AFABFC0]; 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:[4C3F390]; 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,0A533440 call CORINFO_HELP_STRCNS mov ecx,eax mov edx,edi call dword ptr ds:[8475F60] 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:[84B5270] 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)