Skip to content

Regressions in System.Collections.CreateAddAndClear<Int32> #84029

Closed

Description

@performanceautofiler

Run Information

Name Value
Architecture x64
OS alpine 3.15
Queue TigerAlpine
Baseline 5318a311298226b3ec17c9b971551811a9374ce6
Compare 2d2528bbda1e618324a4bc5a2507747941c4bc88
Diff Diff
Configs CompilationMode:tiered, RunKind:micro

Regressions in System.Collections.CreateAddAndClear<Int32>

Benchmark Baseline Test Test/Base Test Quality Edge Detector Baseline IR Compare IR IR Ratio Baseline ETL Compare ETL
ConcurrentQueue - Duration of single invocation 5.31 μs 5.64 μs 1.06 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;Int32&gt;*'
Details

Payloads

Baseline
Compare

Histogram

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


Description of detection logic

IsRegressionChecked: Marked as regression because the three check build points were 0.05 greater than the baseline.
IsImprovementBase: Marked as not an improvement because the compare was not 5% less than the baseline, or the value was too small.
IsRegressionBase: Marked as regression because the compare was 5% greater than the baseline, and the value was not too small.
IsRegressionChecked: Marked as regression because the three check build points were 0.05 greater than the baseline.
IsRegressionWindowed: Marked as regression because 5.6422303047176205 > 5.57128995349662.
IsChangePoint: Marked as a change because one of 3/25/2023 10:49:06 AM, 3/28/2023 8:13:28 AM falls between 3/19/2023 2:30:51 PM and 3/28/2023 8:13:28 AM.
IsRegressionStdDev: Marked as regression because -138.62417101607124 (T) = (0 -5644.476112489088) / Math.Sqrt((80.97032060077886 / (42)) + (62.59883328608294 / (16))) is less than -2.0032407188469383 = MathNet.Numerics.Distributions.StudentT.InvCDF(0, 1, (42) + (16) - 2, .025) and -0.06309650261350963 = (5309.4672954080315 - 5644.476112489088) / 5309.4672954080315 is less than -0.05.
IsImprovementBase: Marked as not an improvement because the compare was not 5% less than the baseline, or the value was too small.
IsChangeEdgeDetector: Marked as regression because Edge Detector said so.

Docs

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

Activity

  1. ghost added
    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners
    on Mar 28, 2023
  2. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Mar 28, 2023
  3. changed the title [-][Perf] Alpine/x64: 1 Regression on 3/25/2023 2:21:39 PM[/-] [+]Regressions in System.Collections.CreateAddAndClear<Int32>[/+] on Mar 28, 2023
  4. EgorBo commented on Mar 28, 2023

    @EgorBo
    Member

    cc @jakobbotsch it seems to be #83814

  5. EgorBo commented on Mar 28, 2023

    @EgorBo
    Member
  6. self-assigned this
    on Mar 28, 2023
  7. added
    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
    on Mar 28, 2023
  8. removed
    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners
    on Mar 28, 2023
  9. removed
    untriagedNew issue has not been triaged by the area owner
    on Mar 28, 2023
  10. added this to the 8.0.0 milestone on Mar 28, 2023
  11. jakobbotsch commented on Mar 28, 2023

    @jakobbotsch
    Member
    Method Job Toolchain Size Mean Error StdDev Median Min Max Ratio RatioSD Gen0 Gen1 Allocated Alloc Ratio
    ConcurrentQueue Job-XBWDOT \65889d126a0d0328836da1d57b19234cfd6240ea\corerun.exe 512 9.174 us 0.3714 us 0.4277 us 9.052 us 8.600 us 9.862 us 1.20 0.06 1.1606 0.0341 9.56 KB 1.00
    ConcurrentQueue Job-YDPPWH \c6cc201665cb3c4d61851392bd8f8d8093688500\corerun.exe 512 7.760 us 0.1336 us 0.1184 us 7.739 us 7.572 us 7.970 us 1.00 0.00 1.1516 - 9.56 KB 1.00
    ConcurrentQueue Job-DPMUDZ \d795694ac7ec2142dd52e776ffd1a204273a5a09\corerun.exe 512 8.066 us 0.1186 us 0.1109 us 8.099 us 7.850 us 8.213 us 1.04 0.02 1.1697 0.0316 9.56 KB 1.00

    So seems this is from 65889d1 but that one should be arm64 only, so that's odd.

  12. added
    Priority:2Work that is important, but not critical for the release
    on Jun 20, 2023
  13. jakobbotsch commented on Jul 5, 2023

    @jakobbotsch
    Member

    I do see a diff that looks related to #83814:

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

    Hot functions:

    • (53.08%) System.Collections.Concurrent.ConcurrentQueueSegment`1.TryEnqueue (Tier-1)
      • Has diffs
    • (20.01%) System.Collections.Concurrent.ConcurrentQueueSegment`1..ctor (Tier-1)
      • No diffs
    • (9.09%) System.Collections.CreateAddAndClear`1.ConcurrentQueue (Tier-1)
      • No diffs
    • (1.37%) System.Collections.Concurrent.ConcurrentQueue`1.EnqueueSlow (Tier-1)
      • No diffs
    Diffs

    [System.Private.CoreLib]System.Collections.Concurrent.ConcurrentQueueSegment`1[System.Int32].TryEnqueue(!0)

     ; Final local variable assignments
     ;
     ;  V00 this         [V00,T01] (  6, 23   )     ref  ->  rcx         this class-hnd single-def
    -;  V01 arg1         [V01,T05] (  3,  2.50)     int  ->  rdx         single-def
    -;  V02 loc0         [V02,T03] (  5, 18   )     ref  ->   r8         class-hnd single-def
    +;  V01 arg1         [V01,T06] (  3,  2.50)     int  ->  rdx         single-def
    +;  V02 loc0         [V02,T04] (  3, 17   )     ref  ->   r8         class-hnd single-def
     ;  V03 loc1         [V03,T00] (  7, 36.50)     int  ->  [rsp+24H]  
    -;  V04 loc2         [V04,T02] (  5, 25   )     int  ->   r9        
    +;  V04 loc2         [V04,T02] (  3, 24   )     int  ->   r9        
     ;* V05 loc3         [V05    ] (  0,  0   )     int  ->  zero-ref   
    -;  V06 loc4         [V06,T04] (  3, 16.50)     int  ->  r10        
    +;  V06 loc4         [V06,T05] (  3, 16.50)     int  ->  r10        
     ;  V07 OutArgs      [V07    ] (  1,  1   )  struct (32) [rsp+00H]   do-not-enreg[XS] addr-exposed "OutgoingArgSpace"
     ;* V08 tmp1         [V08    ] (  0,  0   )   byref  ->  zero-ref    "Inlining Arg"
     ;* V09 tmp2         [V09    ] (  0,  0   )   byref  ->  zero-ref    "Inlining Arg"
     ;* V10 tmp3         [V10    ] (  0,  0   )   byref  ->  zero-ref    "Inlining Arg"
     ;* V11 tmp4         [V11    ] (  0,  0   )     int  ->  zero-ref    "Inlining Arg"
    +;  V12 cse0         [V12,T03] (  4, 17   )   byref  ->   r9         "CSE - aggressive"
     ;
     ; Lcl frame size = 40
     
    @@ -164,11 +165,11 @@ G_M55559_IG03:
            and      r9d, dword ptr [rcx+18H]
            cmp      r9d, dword ptr [r8+08H]
            jae      SHORT G_M55559_IG11
    -       mov      r10d, r9d
    -       mov      r10d, dword ptr [r8+8*r10+14H]
    +       lea      r9, bword ptr [r8+8*r9+10H]
    +       mov      r10d, dword ptr [r9+04H]
            sub      r10d, eax
            jne      SHORT G_M55559_IG06
    -						;; size=32 bbWeight=8 PerfScore 102.00
    +						;; size=33 bbWeight=8 PerfScore 108.00
     G_M55559_IG04:
            lea      r10, bword ptr [rcx+A0H]
            lea      r11d, [rax+01H]
    @@ -194,13 +195,11 @@ G_M55559_IG08:
            ret      
     						;; size=5 bbWeight=0.50 PerfScore 0.62
     G_M55559_IG09:
    -       mov      eax, r9d
    -       mov      dword ptr [r8+8*rax+10H], edx
    -       mov      eax, r9d
    +       mov      dword ptr [r9], edx
            inc      r10d
    -       mov      dword ptr [r8+8*rax+14H], r10d
    +       mov      dword ptr [r9+04H], r10d
            mov      eax, 1
    -						;; size=24 bbWeight=0.50 PerfScore 1.50
    +						;; size=15 bbWeight=0.50 PerfScore 1.25
     G_M55559_IG10:
            add      rsp, 40
            ret      
    @@ -210,6 +209,6 @@ G_M55559_IG11:
            int3     
     						;; size=6 bbWeight=0 PerfScore 0.00
     
    -; Total bytes of code 127, prolog size 4, PerfScore 210.70, instruction count 36, allocated bytes for code 127 (MethodHash=524826f8) for method System.Collections.Concurrent.ConcurrentQueueSegment`1[int]:TryEnqueue(int):bool:this
    +; Total bytes of code 119, prolog size 4, PerfScore 215.65, instruction count 34, allocated bytes for code 119 (MethodHash=524826f8) for method System.Collections.Concurrent.ConcurrentQueueSegment`1[int]:TryEnqueue(int):bool:this
     ; ============================================================
     
    
    

    This is win-x64 codegen though, am trying to collect linux-x64 codegen now. Not sure why alpine x64 would be the only impacted config either, I see no similar regression in Ubuntu 18.04 x64.

  14. jakobbotsch commented on Jul 5, 2023

    @jakobbotsch
    Member

    The linux-x64 codegen looks the same as the above, with slightly different registers.

    Since this is a minor regression and we don't observe it on other x64 perf lab runs I don't think there is anything actionable to do here... certainly adjusting CSE heuristics at this point does not seem desirable. So will close this.

  15. ghost locked as resolved and limited conversation to collaborators on Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Priority:2Work that is important, but not critical for the releasearea-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions