Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Perf] Windows/x86: 5 Improvements on 3/25/2023 2:21:39 PM #14554

Closed
performanceautofiler bot opened this issue Mar 28, 2023 · 1 comment
Closed

[Perf] Windows/x86: 5 Improvements on 3/25/2023 2:21:39 PM #14554

performanceautofiler bot opened this issue Mar 28, 2023 · 1 comment

Comments

@performanceautofiler
Copy link

performanceautofiler bot commented Mar 28, 2023

Run Information

Name Value
Architecture x86
OS Windows 10.0.18362
Queue TigerWindows
Baseline 5318a311298226b3ec17c9b971551811a9374ce6
Compare 2d2528bbda1e618324a4bc5a2507747941c4bc88
Diff Diff
Configs CompilationMode:tiered, RunKind:micro

Improvements in System.Collections.CreateAddAndClear<String>

Benchmark Baseline Test Test/Base Test Quality Edge Detector Baseline IR Compare IR IR Ratio Baseline ETL Compare ETL
ConcurrentQueue - Duration of single invocation 8.62 μs 7.96 μs 0.92 0.00 True

graph
Test Report

Repro

General Docs link: https://github.com/dotnet/performance/blob/main/docs/benchmarking-workflow-dotnet-runtime.md

Payloads

Baseline
Compare

git clone https://github.com/dotnet/performance.git
py .\performance\scripts\benchmarks_ci.py -f net8.0 --filter 'System.Collections.CreateAddAndClear&lt;String&gt;*'

Payloads

Baseline
Compare

Histogram

System.Collections.CreateAddAndClear<String>.ConcurrentQueue(Size: 512)


Description of detection logic

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 7.955360176690452 < 8.161490488070742.
IsChangePoint: Marked as a change because one of 3/25/2023 10:49:06 AM, 3/28/2023 7:07:52 AM falls between 3/19/2023 2:30:51 PM and 3/28/2023 7:07:52 AM.
IsImprovementStdDev: Marked as improvement because 153.5687295607984 (T) = (0 -7967.490923027356) / Math.Sqrt((649.4894700407485 / (299)) + (206.75647974606275 / (15))) is greater than 1.9675964973877862 = MathNet.Numerics.Distributions.StudentT.InvCDF(0, 1, (299) + (15) - 2, .975) and 0.07148757292105173 = (8580.92007243529 - 7967.490923027356) / 8580.92007243529 is greater than 0.05.
IsChangeEdgeDetector: Marked as regression because Edge Detector said so.

Docs

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

Run Information

Name Value
Architecture x86
OS Windows 10.0.18362
Queue TigerWindows
Baseline 5318a311298226b3ec17c9b971551811a9374ce6
Compare 2d2528bbda1e618324a4bc5a2507747941c4bc88
Diff Diff
Configs CompilationMode:tiered, RunKind:micro

Improvements in System.Tests.Perf_Enum

Benchmark Baseline Test Test/Base Test Quality Edge Detector Baseline IR Compare IR IR Ratio Baseline ETL Compare ETL
ToString_Format_NonFlags - Duration of single invocation 14.63 ns 13.61 ns 0.93 0.38 False
GetName_Generic_Flags - Duration of single invocation 8.45 ns 7.37 ns 0.87 0.07 False Trace Trace

graph
graph
Test Report

Repro

General Docs link: https://github.com/dotnet/performance/blob/main/docs/benchmarking-workflow-dotnet-runtime.md

Payloads

Baseline
Compare

git clone https://github.com/dotnet/performance.git
py .\performance\scripts\benchmarks_ci.py -f net8.0 --filter 'System.Tests.Perf_Enum*'

Payloads

Baseline
Compare

Histogram

System.Tests.Perf_Enum.ToString_Format_NonFlags(value: 7, format: "G")


Description of detection logic

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 13.608741808660815 < 14.045893241475214.
IsChangePoint: Marked as a change because one of 3/25/2023 10:49:06 AM, 3/28/2023 7:07:52 AM falls between 3/19/2023 2:30:51 PM and 3/28/2023 7:07:52 AM.
IsImprovementStdDev: Marked as improvement because 10.179123554794515 (T) = (0 -13.842415010947452) / Math.Sqrt((0.5113388181134761 / (299)) + (0.2226206910311887 / (15))) is greater than 1.9675964973877862 = MathNet.Numerics.Distributions.StudentT.InvCDF(0, 1, (299) + (15) - 2, .975) and 0.08642910474070294 = (15.15198774695924 - 13.842415010947452) / 15.15198774695924 is greater than 0.05.
IsChangeEdgeDetector: Marked not as a regression because Edge Detector said so.

```#### System.Tests.Perf_Enum.GetName_Generic_Flags

```log

Description of detection logic

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 7.366604078189644 < 7.954322372855997.
IsChangePoint: Marked as a change because one of 1/18/2023 6:24:13 PM, 1/21/2023 1:51:00 AM, 2/17/2023 9:53:52 PM, 3/20/2023 8:31:51 AM, 3/28/2023 7:07:52 AM falls between 3/19/2023 2:30:51 PM and 3/28/2023 7:07:52 AM.
IsImprovementStdDev: Marked as improvement because 27.283379217791218 (T) = (0 -7.139232914130608) / Math.Sqrt((0.2421364596984002 / (299)) + (0.01341751866029776 / (45))) is greater than 1.9669246454804268 = MathNet.Numerics.Distributions.StudentT.InvCDF(0, 1, (299) + (45) - 2, .975) and 0.11285222081736958 = (8.047399860154425 - 7.139232914130608) / 8.047399860154425 is greater than 0.05.
IsChangeEdgeDetector: Marked not as a regression because Edge Detector said so.

```### Baseline BDN Disasm

```assembly
; System.Tests.Perf_Enum.GetName_Generic_Flags()
       push      ebp
       mov       ebp,esp
       push      edi
       push      esi
       sub       esp,14
       mov       ecx,[ecx+8]
       mov       [ebp-0C],ecx
       mov       ecx,ds:[89B8278]
       test      ecx,ecx
       je        short M00_L03
       mov       ecx,[ecx]
M00_L00:
       test      ecx,ecx
       je        short M00_L02
       mov       eax,[ecx+3C]
M00_L01:
       test      eax,eax
       je        short M00_L04
       cmp       dword ptr [eax],offset MT_System.Enum+EnumInfo`1[[System.Int32, System.Private.CoreLib]]
       jne       short M00_L04
       cmp       dword ptr [eax+8],0
       je        short M00_L04
       jmp       short M00_L05
M00_L02:
       xor       eax,eax
       jmp       short M00_L01
M00_L03:
       xor       ecx,ecx
       jmp       short M00_L00
M00_L04:
       mov       ecx,89B8270
       mov       edx,1
       call      dword ptr ds:[0B589618]; System.Enum.<GetEnumInfo>g__InitializeEnumInfo|7_0[[System.Int32, System.Private.CoreLib]](System.RuntimeType, Boolean)
M00_L05:
       mov       edx,[ebp-0C]
       mov       esi,[eax+8]
       cmp       byte ptr [eax+0D],0
       je        short M00_L06
       cmp       [esi+4],edx
       jbe       short M00_L11
       cmp       edx,[esi+4]
       jae       short M00_L13
       mov       eax,[esi+edx*4+8]
       jmp       short M00_L12
M00_L06:
       mov       ecx,[eax+4]
       test      ecx,ecx
       jne       short M00_L07
       xor       eax,eax
       xor       edi,edi
       jmp       short M00_L08
M00_L07:
       lea       eax,[ecx+8]
       mov       edi,[ecx+4]
M00_L08:
       cmp       dword ptr [ecx+4],20
       jle       short M00_L09
       push      edx
       mov       ecx,eax
       mov       edx,edi
       call      dword ptr ds:[0BB7B0F0]
       jmp       short M00_L10
M00_L09:
       push      edi
       mov       ecx,eax
       call      dword ptr ds:[0BB75618]; System.SpanHelpers.NonPackedIndexOfValueType[[System.Int32, System.Private.CoreLib],[System.SpanHelpers+DontNegate`1[[System.Int32, System.Private.CoreLib]], System.Private.CoreLib]](Int32 ByRef, Int32, Int32)
M00_L10:
       cmp       [esi+4],eax
       jbe       short M00_L11
       cmp       eax,[esi+4]
       jae       short M00_L13
       mov       eax,[esi+eax*4+8]
       jmp       short M00_L12
M00_L11:
       xor       eax,eax
M00_L12:
       lea       esp,[ebp-8]
       pop       esi
       pop       edi
       pop       ebp
       ret
M00_L13:
       call      CORINFO_HELP_RNGCHKFAIL
       int       3
; Total bytes of code 183
; System.Enum.<GetEnumInfo>g__InitializeEnumInfo|7_0[[System.Int32, System.Private.CoreLib]](System.RuntimeType, Boolean)
       push      ebp
       mov       ebp,esp
       push      edi
       push      esi
       push      ebx
       sub       esp,3C
       xor       ebx,ebx
       mov       [ebp-14],ebx
       mov       [ebp-18],ebx
       mov       [ebp-10],ecx
       lea       edi,[ebp-44]
       call      CORINFO_HELP_INIT_PINVOKE_FRAME
       mov       eax,ebp
       mov       [ebp-30],eax
       xor       eax,eax
       mov       [ebp-20],eax
       mov       [ebp-1C],eax
       lea       eax,[ebp-10]
       mov       [ebp-20],eax
       mov       eax,[ebp-10]
       lea       edi,[ebp-20]
       test      eax,eax
       je        near ptr M01_L09
       mov       ebx,[eax+0C]
M01_L00:
       mov       [edi+4],ebx
       mov       eax,[ebp-20]
       mov       ecx,[ebp-1C]
       lea       edi,[ebp-14]
       lea       ebx,[ebp-18]
       test      dl,dl
       jne       short M01_L01
       xor       edx,edx
       jmp       short M01_L02
M01_L01:
       mov       edx,1
M01_L02:
       push      edx
       push      ebx
       push      edi
       push      ecx
       push      eax
       mov       dword ptr [ebp-3C],53D9758
       mov       eax,esp
       mov       [ebp-38],eax
       lea       eax,[M01_L03]
       mov       [ebp-34],eax
       mov       byte ptr [esi+8],0
       mov       eax,6C159BE0
       call      eax
M01_L03:
       mov       byte ptr [esi+8],1
       cmp       dword ptr ds:[6C4B1778],0
       je        short M01_L04
       call      CORINFO_HELP_STOP_FOR_GC
M01_L04:
       xor       ecx,ecx
       mov       [ebp-34],ecx
       push      0
       mov       ecx,[ebp-10]
       mov       edx,89B4DCC
       cmp       [ecx],ecx
       call      dword ptr ds:[5477AF4]; System.RuntimeType.IsDefined(System.Type, Boolean)
       mov       ebx,eax
       mov       ecx,offset MT_System.Enum+EnumInfo`1[[System.Int32, System.Private.CoreLib]]
       call      CORINFO_HELP_NEWSFAST
       mov       edi,eax
       mov       eax,[ebp-14]
       mov       [ebp-24],eax
       mov       ecx,[ebp-18]
       mov       [ebp-28],ecx
       mov       [edi+0C],bl
       lea       edx,[edi+4]
       call      CORINFO_HELP_ASSIGN_REF_EAX
       lea       edx,[edi+8]
       call      CORINFO_HELP_ASSIGN_REF_ECX
       mov       ecx,eax
       call      dword ptr ds:[0B589D50]; System.Enum.AreSorted[[System.Int32, System.Private.CoreLib]](Int32[])
       test      eax,eax
       jne       short M01_L06
       mov       ebx,[ebp-24]
       test      ebx,ebx
       je        short M01_L10
       push      0
       push      dword ptr [ebx+4]
       push      0
       push      offset MD_System.Array.Sort[[System.Int32, System.Private.CoreLib],[System.String, System.Private.CoreLib]](Int32[], System.String[], Int32, Int32, System.Collections.Generic.IComparer`1<Int32>)
       mov       ecx,ebx
       mov       edx,[ebp-28]
       call      dword ptr ds:[0B589D20]
M01_L05:
       mov       ecx,ebx
       call      dword ptr ds:[0B589D68]; System.Enum.AreSequentialFromZero[[System.Int32, System.Private.CoreLib]](Int32[])
       mov       [edi+0D],al
       mov       ecx,[ebp-10]
       cmp       dword ptr [ecx+8],0
       je        short M01_L07
       mov       eax,[ecx+8]
       mov       eax,[eax]
       test      eax,eax
       je        short M01_L07
       jmp       short M01_L08
M01_L06:
       mov       ebx,[ebp-24]
       jmp       short M01_L05
M01_L07:
       call      dword ptr ds:[54D5AB0]; System.RuntimeType.InitializeCache()
M01_L08:
       lea       edx,[eax+3C]
       call      CORINFO_HELP_ASSIGN_REF_EDI
       mov       eax,edi
       mov       ecx,[ebp-40]
       mov       [esi+0C],ecx
       lea       esp,[ebp-0C]
       pop       ebx
       pop       esi
       pop       edi
       pop       ebp
       ret
M01_L09:
       xor       ebx,ebx
       jmp       near ptr M01_L00
M01_L10:
       mov       ecx,4B
       call      dword ptr ds:[9057588]
       int       3
; Total bytes of code 342
; System.SpanHelpers.NonPackedIndexOfValueType[[System.Int32, System.Private.CoreLib],[System.SpanHelpers+DontNegate`1[[System.Int32, System.Private.CoreLib]], System.Private.CoreLib]](Int32 ByRef, Int32, Int32)
       push      ebp
       mov       ebp,esp
       push      edi
       push      esi
       push      ebx
       vzeroupper
       mov       eax,[ebp+8]
       cmp       eax,4
       jge       near ptr M02_L12
       xor       esi,esi
       cmp       eax,8
       jl        short M02_L01
M02_L00:
       add       eax,0FFFFFFF8
       cmp       [ecx+esi*4],edx
       je        near ptr M02_L11
       cmp       [ecx+esi*4+4],edx
       je        near ptr M02_L10
       cmp       [ecx+esi*4+8],edx
       je        near ptr M02_L09
       cmp       [ecx+esi*4+0C],edx
       je        near ptr M02_L08
       cmp       [ecx+esi*4+10],edx
       je        short M02_L07
       nop
       nop
       nop
       nop
       cmp       [ecx+esi*4+14],edx
       je        short M02_L06
       nop
       nop
       nop
       nop
       cmp       [ecx+esi*4+18],edx
       je        short M02_L05
       cmp       [ecx+esi*4+1C],edx
       je        short M02_L04
       add       esi,8
       cmp       eax,8
       jge       short M02_L00
M02_L01:
       cmp       eax,4
       jl        short M02_L02
       add       eax,0FFFFFFFC
       cmp       [ecx+esi*4],edx
       je        short M02_L11
       nop
       nop
       nop
       nop
       cmp       [ecx+esi*4+4],edx
       je        short M02_L10
       cmp       [ecx+esi*4+8],edx
       je        short M02_L09
       cmp       [ecx+esi*4+0C],edx
       je        short M02_L08
       add       esi,4
M02_L02:
       test      eax,eax
       jle       near ptr M02_L21
       nop
       nop
       nop
       nop
M02_L03:
       dec       eax
       cmp       [ecx+esi*4],edx
       je        short M02_L11
       inc       esi
       test      eax,eax
       jg        short M02_L03
       jmp       near ptr M02_L21
M02_L04:
       lea       eax,[esi+7]
       jmp       near ptr M02_L20
M02_L05:
       lea       eax,[esi+6]
       jmp       near ptr M02_L20
M02_L06:
       lea       eax,[esi+5]
       jmp       near ptr M02_L20
M02_L07:
       lea       eax,[esi+4]
       jmp       near ptr M02_L20
M02_L08:
       lea       eax,[esi+3]
       jmp       near ptr M02_L20
M02_L09:
       lea       eax,[esi+2]
       jmp       near ptr M02_L20
M02_L10:
       lea       eax,[esi+1]
       jmp       near ptr M02_L20
M02_L11:
       mov       eax,esi
       jmp       near ptr M02_L20
M02_L12:
       cmp       eax,8
       jl        short M02_L16
       vmovd     xmm0,edx
       vpbroadcastd ymm0,xmm0
       mov       edx,ecx
       lea       esi,[edx+eax*4-20]
M02_L13:
       vpcmpeqd  ymm1,ymm0,[edx]
       vptest    ymm1,ymm1
       jne       short M02_L15
       add       edx,20
       cmp       edx,esi
       jbe       short M02_L13
       xor       edx,edx
       mov       edi,8
       cmp       edx,edi
       jb        short M02_L14
       mov       ebx,eax
       mov       eax,edx
       xor       edx,edx
       div       edi
       mov       eax,ebx
M02_L14:
       div       edi
       or        edx,0
       je        near ptr M02_L21
       vpcmpeqd  ymm1,ymm0,[esi]
       vptest    ymm1,ymm1
       je        near ptr M02_L21
       sub       esi,ecx
       shr       esi,2
       vmovmskps ecx,ymm1
       xor       eax,eax
       tzcnt     eax,ecx
       add       eax,esi
       jmp       near ptr M02_L20
M02_L15:
       mov       eax,edx
       sub       eax,ecx
       shr       eax,2
       vmovmskps ecx,ymm1
       xor       edx,edx
       tzcnt     edx,ecx
       add       eax,edx
       jmp       short M02_L20
M02_L16:
       vmovd     xmm0,edx
       vpbroadcastd xmm0,xmm0
       mov       edx,ecx
       lea       esi,[edx+eax*4-10]
M02_L17:
       vpcmpeqd  xmm1,xmm0,[edx]
       vptest    xmm1,xmm1
       jne       short M02_L19
       add       edx,10
       cmp       edx,esi
       jbe       short M02_L17
       xor       edx,edx
       mov       edi,4
       cmp       edx,edi
       jb        short M02_L18
       mov       ebx,eax
       mov       eax,edx
       xor       edx,edx
       div       edi
       mov       eax,ebx
M02_L18:
       div       edi
       or        edx,0
       je        short M02_L21
       vpcmpeqd  xmm1,xmm0,[esi]
       vptest    xmm1,xmm1
       je        short M02_L21
       sub       esi,ecx
       shr       esi,2
       vmovmskps ecx,xmm1
       xor       eax,eax
       tzcnt     eax,ecx
       add       eax,esi
       jmp       short M02_L20
M02_L19:
       mov       eax,edx
       sub       eax,ecx
       shr       eax,2
       vmovmskps edx,xmm1
       tzcnt     edx,edx
       add       eax,edx
M02_L20:
       vzeroupper
       pop       ebx
       pop       esi
       pop       edi
       pop       ebp
       ret       4
M02_L21:
       mov       eax,0FFFFFFFF
       vzeroupper
       pop       ebx
       pop       esi
       pop       edi
       pop       ebp
       ret       4
; Total bytes of code 500

Compare BDN Disasm

; System.Tests.Perf_Enum.GetName_Generic_Flags()
       push      ebp
       mov       ebp,esp
       push      edi
       push      esi
       sub       esp,14
       mov       ecx,[ecx+8]
       mov       [ebp-0C],ecx
       mov       ecx,ds:[7D383F4]
       test      ecx,ecx
       je        short M00_L03
       mov       ecx,[ecx]
M00_L00:
       test      ecx,ecx
       je        short M00_L02
       mov       eax,[ecx+3C]
M00_L01:
       test      eax,eax
       je        short M00_L04
       cmp       dword ptr [eax],offset MT_System.Enum+EnumInfo`1[[System.UInt32, System.Private.CoreLib]]
       jne       short M00_L04
       cmp       dword ptr [eax+8],0
       je        short M00_L04
       jmp       short M00_L05
M00_L02:
       xor       eax,eax
       jmp       short M00_L01
M00_L03:
       xor       ecx,ecx
       jmp       short M00_L00
M00_L04:
       mov       ecx,7D383EC
       mov       edx,1
       call      dword ptr ds:[0A5BFED0]; System.Enum.<GetEnumInfo>g__InitializeEnumInfo|7_0[[System.UInt32, System.Private.CoreLib]](System.RuntimeType, Boolean)
M00_L05:
       mov       edx,[ebp-0C]
       mov       esi,[eax+8]
       cmp       byte ptr [eax+0D],0
       je        short M00_L06
       cmp       [esi+4],edx
       jbe       short M00_L11
       mov       eax,[esi+edx*4+8]
       jmp       short M00_L12
M00_L06:
       mov       ecx,[eax+4]
       test      ecx,ecx
       jne       short M00_L07
       xor       eax,eax
       xor       edi,edi
       jmp       short M00_L08
M00_L07:
       lea       eax,[ecx+8]
       mov       edi,[ecx+4]
M00_L08:
       cmp       dword ptr [ecx+4],20
       jle       short M00_L09
       push      edx
       mov       ecx,eax
       mov       edx,edi
       call      dword ptr ds:[0AED1468]
       jmp       short M00_L10
M00_L09:
       push      edi
       mov       ecx,eax
       call      dword ptr ds:[0AEBBD80]; System.SpanHelpers.NonPackedIndexOfValueType[[System.Int32, System.Private.CoreLib],[System.SpanHelpers+DontNegate`1[[System.Int32, System.Private.CoreLib]], System.Private.CoreLib]](Int32 ByRef, Int32, Int32)
M00_L10:
       cmp       [esi+4],eax
       jbe       short M00_L11
       mov       eax,[esi+eax*4+8]
       jmp       short M00_L12
M00_L11:
       xor       eax,eax
M00_L12:
       lea       esp,[ebp-8]
       pop       esi
       pop       edi
       pop       ebp
       ret
; Total bytes of code 167
; System.Enum.<GetEnumInfo>g__InitializeEnumInfo|7_0[[System.UInt32, System.Private.CoreLib]](System.RuntimeType, Boolean)
       push      ebp
       mov       ebp,esp
       push      edi
       push      esi
       push      ebx
       sub       esp,3C
       xor       ebx,ebx
       mov       [ebp-14],ebx
       mov       [ebp-18],ebx
       mov       [ebp-10],ecx
       lea       edi,[ebp-44]
       call      CORINFO_HELP_INIT_PINVOKE_FRAME
       mov       eax,ebp
       mov       [ebp-30],eax
       xor       eax,eax
       mov       [ebp-20],eax
       mov       [ebp-1C],eax
       lea       eax,[ebp-10]
       mov       [ebp-20],eax
       mov       eax,[ebp-10]
       lea       edi,[ebp-20]
       test      eax,eax
       je        near ptr M01_L09
       mov       ebx,[eax+0C]
M01_L00:
       mov       [edi+4],ebx
       mov       eax,[ebp-20]
       mov       ecx,[ebp-1C]
       lea       edi,[ebp-14]
       lea       ebx,[ebp-18]
       test      dl,dl
       jne       short M01_L01
       xor       edx,edx
       jmp       short M01_L02
M01_L01:
       mov       edx,1
M01_L02:
       push      edx
       push      ebx
       push      edi
       push      ecx
       push      eax
       mov       dword ptr [ebp-3C],8597A8
       mov       eax,esp
       mov       [ebp-38],eax
       lea       eax,[M01_L03]
       mov       [ebp-34],eax
       mov       byte ptr [esi+8],0
       mov       eax,6C3A6FB0
       call      eax
M01_L03:
       mov       byte ptr [esi+8],1
       cmp       dword ptr ds:[6C7507F8],0
       je        short M01_L04
       call      CORINFO_HELP_STOP_FOR_GC
M01_L04:
       xor       ecx,ecx
       mov       [ebp-34],ecx
       push      0
       mov       ecx,[ebp-10]
       mov       edx,7D34DCC
       cmp       [ecx],ecx
       call      dword ptr ds:[0D07BA4]; System.RuntimeType.IsDefined(System.Type, Boolean)
       mov       ebx,eax
       mov       ecx,offset MT_System.Enum+EnumInfo`1[[System.UInt32, System.Private.CoreLib]]
       call      CORINFO_HELP_NEWSFAST
       mov       edi,eax
       mov       eax,[ebp-14]
       mov       [ebp-24],eax
       mov       ecx,[ebp-18]
       mov       [ebp-28],ecx
       mov       [edi+0C],bl
       lea       edx,[edi+4]
       call      CORINFO_HELP_ASSIGN_REF_EAX
       lea       edx,[edi+8]
       call      CORINFO_HELP_ASSIGN_REF_ECX
       mov       ecx,eax
       call      dword ptr ds:[0A961618]; System.Enum.AreSorted[[System.UInt32, System.Private.CoreLib]](UInt32[])
       test      eax,eax
       jne       short M01_L06
       mov       ebx,[ebp-24]
       test      ebx,ebx
       je        short M01_L10
       push      0
       push      dword ptr [ebx+4]
       push      0
       push      offset MD_System.Array.Sort[[System.UInt32, System.Private.CoreLib],[System.String, System.Private.CoreLib]](UInt32[], System.String[], Int32, Int32, System.Collections.Generic.IComparer`1<UInt32>)
       mov       ecx,ebx
       mov       edx,[ebp-28]
       call      dword ptr ds:[0A9615E8]
M01_L05:
       mov       ecx,ebx
       call      dword ptr ds:[0A961630]; System.Enum.AreSequentialFromZero[[System.UInt32, System.Private.CoreLib]](UInt32[])
       mov       [edi+0D],al
       mov       ecx,[ebp-10]
       cmp       dword ptr [ecx+8],0
       je        short M01_L07
       mov       eax,[ecx+8]
       mov       eax,[eax]
       test      eax,eax
       je        short M01_L07
       jmp       short M01_L08
M01_L06:
       mov       ebx,[ebp-24]
       jmp       short M01_L05
M01_L07:
       call      dword ptr ds:[0DF5A98]; System.RuntimeType.InitializeCache()
M01_L08:
       lea       edx,[eax+3C]
       call      CORINFO_HELP_ASSIGN_REF_EDI
       mov       eax,edi
       mov       ecx,[ebp-40]
       mov       [esi+0C],ecx
       lea       esp,[ebp-0C]
       pop       ebx
       pop       esi
       pop       edi
       pop       ebp
       ret
M01_L09:
       xor       ebx,ebx
       jmp       near ptr M01_L00
M01_L10:
       mov       ecx,4B
       call      dword ptr ds:[83C9588]
       int       3
; Total bytes of code 342
; System.SpanHelpers.NonPackedIndexOfValueType[[System.Int32, System.Private.CoreLib],[System.SpanHelpers+DontNegate`1[[System.Int32, System.Private.CoreLib]], System.Private.CoreLib]](Int32 ByRef, Int32, Int32)
       push      ebp
       mov       ebp,esp
       push      edi
       push      esi
       push      ebx
       vzeroupper
       mov       eax,[ebp+8]
       cmp       eax,4
       jge       near ptr M02_L12
       xor       esi,esi
       cmp       eax,8
       jl        short M02_L01
M02_L00:
       add       eax,0FFFFFFF8
       cmp       [ecx+esi*4],edx
       je        near ptr M02_L11
       cmp       [ecx+esi*4+4],edx
       je        near ptr M02_L10
       cmp       [ecx+esi*4+8],edx
       je        near ptr M02_L09
       cmp       [ecx+esi*4+0C],edx
       je        near ptr M02_L08
       cmp       [ecx+esi*4+10],edx
       je        short M02_L07
       nop
       nop
       nop
       nop
       cmp       [ecx+esi*4+14],edx
       je        short M02_L06
       nop
       nop
       nop
       nop
       cmp       [ecx+esi*4+18],edx
       je        short M02_L05
       cmp       [ecx+esi*4+1C],edx
       je        short M02_L04
       add       esi,8
       cmp       eax,8
       jge       short M02_L00
M02_L01:
       cmp       eax,4
       jl        short M02_L02
       add       eax,0FFFFFFFC
       cmp       [ecx+esi*4],edx
       je        short M02_L11
       nop
       nop
       nop
       nop
       cmp       [ecx+esi*4+4],edx
       je        short M02_L10
       cmp       [ecx+esi*4+8],edx
       je        short M02_L09
       cmp       [ecx+esi*4+0C],edx
       je        short M02_L08
       add       esi,4
M02_L02:
       test      eax,eax
       jle       near ptr M02_L21
       nop
       nop
       nop
       nop
M02_L03:
       dec       eax
       cmp       [ecx+esi*4],edx
       je        short M02_L11
       inc       esi
       test      eax,eax
       jg        short M02_L03
       jmp       near ptr M02_L21
M02_L04:
       lea       eax,[esi+7]
       jmp       near ptr M02_L20
M02_L05:
       lea       eax,[esi+6]
       jmp       near ptr M02_L20
M02_L06:
       lea       eax,[esi+5]
       jmp       near ptr M02_L20
M02_L07:
       lea       eax,[esi+4]
       jmp       near ptr M02_L20
M02_L08:
       lea       eax,[esi+3]
       jmp       near ptr M02_L20
M02_L09:
       lea       eax,[esi+2]
       jmp       near ptr M02_L20
M02_L10:
       lea       eax,[esi+1]
       jmp       near ptr M02_L20
M02_L11:
       mov       eax,esi
       jmp       near ptr M02_L20
M02_L12:
       cmp       eax,8
       jl        short M02_L16
       vmovd     xmm0,edx
       vpbroadcastd ymm0,xmm0
       mov       edx,ecx
       lea       esi,[edx+eax*4-20]
M02_L13:
       vpcmpeqd  ymm1,ymm0,[edx]
       vptest    ymm1,ymm1
       jne       short M02_L15
       add       edx,20
       cmp       edx,esi
       jbe       short M02_L13
       xor       edx,edx
       mov       edi,8
       cmp       edx,edi
       jb        short M02_L14
       mov       ebx,eax
       mov       eax,edx
       xor       edx,edx
       div       edi
       mov       eax,ebx
M02_L14:
       div       edi
       or        edx,0
       je        near ptr M02_L21
       vpcmpeqd  ymm1,ymm0,[esi]
       vptest    ymm1,ymm1
       je        near ptr M02_L21
       sub       esi,ecx
       shr       esi,2
       vmovmskps ecx,ymm1
       xor       eax,eax
       tzcnt     eax,ecx
       add       eax,esi
       jmp       near ptr M02_L20
M02_L15:
       mov       eax,edx
       sub       eax,ecx
       shr       eax,2
       vmovmskps ecx,ymm1
       xor       edx,edx
       tzcnt     edx,ecx
       add       eax,edx
       jmp       short M02_L20
M02_L16:
       vmovd     xmm0,edx
       vpbroadcastd xmm0,xmm0
       mov       edx,ecx
       lea       esi,[edx+eax*4-10]
M02_L17:
       vpcmpeqd  xmm1,xmm0,[edx]
       vptest    xmm1,xmm1
       jne       short M02_L19
       add       edx,10
       cmp       edx,esi
       jbe       short M02_L17
       xor       edx,edx
       mov       edi,4
       cmp       edx,edi
       jb        short M02_L18
       mov       ebx,eax
       mov       eax,edx
       xor       edx,edx
       div       edi
       mov       eax,ebx
M02_L18:
       div       edi
       or        edx,0
       je        short M02_L21
       vpcmpeqd  xmm1,xmm0,[esi]
       vptest    xmm1,xmm1
       je        short M02_L21
       sub       esi,ecx
       shr       esi,2
       vmovmskps ecx,xmm1
       xor       eax,eax
       tzcnt     eax,ecx
       add       eax,esi
       jmp       short M02_L20
M02_L19:
       mov       eax,edx
       sub       eax,ecx
       shr       eax,2
       vmovmskps edx,xmm1
       tzcnt     edx,edx
       add       eax,edx
M02_L20:
       vzeroupper
       pop       ebx
       pop       esi
       pop       edi
       pop       ebp
       ret       4
M02_L21:
       mov       eax,0FFFFFFFF
       vzeroupper
       pop       ebx
       pop       esi
       pop       edi
       pop       ebp
       ret       4
; Total bytes of code 500

Docs

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

Run Information

Name Value
Architecture x86
OS Windows 10.0.18362
Queue TigerWindows
Baseline 5318a311298226b3ec17c9b971551811a9374ce6
Compare 2d2528bbda1e618324a4bc5a2507747941c4bc88
Diff Diff
Configs CompilationMode:tiered, RunKind:micro

Improvements in System.Text.RegularExpressions.Tests.Perf_Regex_Industry_Leipzig

Benchmark Baseline Test Test/Base Test Quality Edge Detector Baseline IR Compare IR IR Ratio Baseline ETL Compare ETL
Count - Duration of single invocation 1.38 secs 1.19 secs 0.86 0.09 False

graph
Test Report

Repro

General Docs link: https://github.com/dotnet/performance/blob/main/docs/benchmarking-workflow-dotnet-runtime.md

Payloads

Baseline
Compare

git clone https://github.com/dotnet/performance.git
py .\performance\scripts\benchmarks_ci.py -f net8.0 --filter 'System.Text.RegularExpressions.Tests.Perf_Regex_Industry_Leipzig*'

Payloads

Baseline
Compare

Histogram

System.Text.RegularExpressions.Tests.Perf_Regex_Industry_Leipzig.Count(Pattern: "([A-Za-z]awyer|[A-Za-z]inn)\s", Options: None)


Description of detection logic

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.1867521666666667 < 1.307152424.
IsChangePoint: Marked as a change because one of 2/20/2023 10:31:48 AM, 3/25/2023 10:49:06 AM, 3/28/2023 7:07:52 AM falls between 3/19/2023 2:30:51 PM and 3/28/2023 7:07:52 AM.
IsImprovementStdDev: Marked as improvement because 15.46510655134269 (T) = (0 -1194373413.6019537) / Math.Sqrt((7457557920653391 / (299)) + (139636472936806.17 / (15))) is greater than 1.9675964973877862 = MathNet.Numerics.Distributions.StudentT.InvCDF(0, 1, (299) + (15) - 2, .975) and 0.0704409042215553 = (1284881638.0003731 - 1194373413.6019537) / 1284881638.0003731 is greater than 0.05.
IsChangeEdgeDetector: Marked not as a regression because Edge Detector said so.

Docs

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

Run Information

Name Value
Architecture x86
OS Windows 10.0.18362
Queue TigerWindows
Baseline 5318a311298226b3ec17c9b971551811a9374ce6
Compare 2d2528bbda1e618324a4bc5a2507747941c4bc88
Diff Diff
Configs CompilationMode:tiered, RunKind:micro

Improvements in System.Collections.CtorFromCollection<Int32>

Benchmark Baseline Test Test/Base Test Quality Edge Detector Baseline IR Compare IR IR Ratio Baseline ETL Compare ETL
SortedList - Duration of single invocation 14.83 μs 12.81 μs 0.86 0.02 False

graph
Test Report

Repro

General Docs link: https://github.com/dotnet/performance/blob/main/docs/benchmarking-workflow-dotnet-runtime.md

Payloads

Baseline
Compare

git clone https://github.com/dotnet/performance.git
py .\performance\scripts\benchmarks_ci.py -f net8.0 --filter 'System.Collections.CtorFromCollection&lt;Int32&gt;*'

Payloads

Baseline
Compare

Histogram

System.Collections.CtorFromCollection<Int32>.SortedList(Size: 512)


Description of detection logic

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 12.80896569433032 < 14.070819754464287.
IsChangePoint: Marked as a change because one of 2/24/2023 9:01:57 AM, 3/25/2023 10:49:06 AM, 3/28/2023 7:07:52 AM falls between 3/19/2023 2:30:51 PM and 3/28/2023 7:07:52 AM.
IsImprovementStdDev: Marked as improvement because 15.959891948210482 (T) = (0 -12879.691105383) / Math.Sqrt((1130047.297871896 / (299)) + (3898.900436187321 / (15))) is greater than 1.9675964973877862 = MathNet.Numerics.Distributions.StudentT.InvCDF(0, 1, (299) + (15) - 2, .975) and 0.073005775999869 = (13894.035984178021 - 12879.691105383) / 13894.035984178021 is greater than 0.05.
IsChangeEdgeDetector: Marked not as a regression because Edge Detector said so.

Docs

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

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

No branches or pull requests

2 participants