Open performanceautofiler[bot] opened 3 years ago
@AndyAyersMS PGO
The change in System.Collections.CtorFromCollection<Int32>
came from https://github.com/dotnet/runtime/pull/52966.
@jakobbotsch can you look at the PGO data before/after and see if you can see what might have impacted this? If you open up the details tab under the chart you can find downloads of the two versions that were tested.
https://github.com/dotnet/runtime/commit/becccb2c3c4556bbcdfde27a101e7615544da7ab is using the 1.0.0-prerelease.21267.7 nuget package of the PGO data while https://github.com/dotnet/runtime/commit/c0860776f133fa98d3d2ef412821c9d3dd48b4fb is using 1.0.0-prerelease.21270.4. Downloading those, merging them (to simulate what the build does) and then comparing them gives the following: https://gist.github.com/jakobbotsch/edb6f940d089aa98b50761351d0b49a4 Now this is comparing the sparse edge profiles which I'm not 100% about. With that said, some interesting observations:
When comparing the flow-graphs of the matching methods, their overlaps break down as follows:
100% ███████████████████████████████████████████████████████████████████████████████████████▍ (80.3%)
>95% ██████████████▍ (13.3%)
>90% ██▍ (2.3%)
>85% █▏ (1.1%)
>80% ▊ (0.7%)
>75% ▍ (0.4%)
>70% ▍ (0.4%)
>65% ▍ (0.4%)
>60% ▏ (0.2%)
>55% ▎ (0.2%)
>50% ▏ (0.1%)
>45% ▏ (0.1%)
>40% ▏ (0.1%)
>35% ▏ (0.1%)
>30% ▏ (0.1%)
>25% ▏ (0.1%)
>20% ▏ (0.0%)
>15% ▏ (0.1%)
>10% ▏ (0.0%)
> 5% ▏ (0.0%)
> 0% ▏ (0.1%)
0% ▏ (0.0%)
But:
[S.P.CoreLib]System.Collections.Generic.Dictionary`2<System.ValueTuple`2<System.__Canon,System.__Canon>,System.__Canon>.TryGetValue(ValueTuple`2<__Canon,__Canon>,__Canon&)
(0.07% overlap)[S.P.CoreLib]System.SpanHelpers.IndexOf<int32>(int32&,int32,int32)
(0.09% overlap)[S.P.CoreLib]System.Collections.Generic.HashSet`1<System.__Canon>.ConstructFrom(HashSet`1<__Canon>)
(0.68% overlap) (could explain the HashSet regression?)[S.P.CoreLib]System.Array.Clear(Array)
(27.65% overlap)[S.P.CoreLib]System.Collections.Generic.ArraySortHelper`1<System.__Canon>.IntroSort(Span`1<__Canon>,int32,Comparison`1<__Canon>)
(28.44% overlap) (could explain the sorting regression?)Some interesting data here. I can see if I can overlay the edge counts on some of their flow graphs tomorrow, though not entirely sure how easy it is to do that with the sparse edge profiles.
I tried reproducing this locally by downloading the baseline/compare versions in the post above, but the variance seems very high. I tried with the Append_Char
tests and I can basically get any conclusion by running it a few times. Here's the results from a few runs:
Method | Job | Toolchain | length | Mean | Error | Median | Min | Max | Ratio | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Append_Char | Job-ROJTIC | \baseline\Core_Root\corerun.exe | 100 | 495.5 μs | NA | 495.5 μs | 495.5 μs | 495.5 μs | 1.00 | - | - | - | 592 B |
Append_Char | Job-HCLUJV | \compare\Core_Root\corerun.exe | 100 | 459.0 μs | NA | 459.0 μs | 459.0 μs | 459.0 μs | 0.93 | - | - | - | 592 B |
Append_Char | Job-ROJTIC | \baseline\Core_Root\corerun.exe | 100000 | 757.6 μs | NA | 757.6 μs | 757.6 μs | 757.6 μs | 1.00 | - | - | - | 210,016 B |
Append_Char | Job-HCLUJV | \compare\Core_Root\corerun.exe | 100000 | 669.3 μs | NA | 669.3 μs | 669.3 μs | 669.3 μs | 0.88 | - | - | - | 210,016 B |
Method | Job | Toolchain | length | Mean | Error | Median | Min | Max | Ratio | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Append_Char | Job-TAMWIF | \baseline\Core_Root\corerun.exe | 100 | 614.1 μs | NA | 614.1 μs | 614.1 μs | 614.1 μs | 1.00 | - | - | - | 592 B |
Append_Char | Job-XZVEFO | \compare\Core_Root\corerun.exe | 100 | 549.1 μs | NA | 549.1 μs | 549.1 μs | 549.1 μs | 0.89 | - | - | - | 592 B |
Append_Char | Job-TAMWIF | \baseline\Core_Root\corerun.exe | 100000 | 717.1 μs | NA | 717.1 μs | 717.1 μs | 717.1 μs | 1.00 | - | - | - | 210,016 B |
Append_Char | Job-XZVEFO | \compare\Core_Root\corerun.exe | 100000 | 718.4 μs | NA | 718.4 μs | 718.4 μs | 718.4 μs | 1.00 | - | - | - | 210,016 B |
Method | Job | Toolchain | length | Mean | Error | Median | Min | Max | Ratio | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Append_Char | Job-AQYTDT | \baseline\Core_Root\corerun.exe | 100 | 561.2 μs | NA | 561.2 μs | 561.2 μs | 561.2 μs | 1.00 | - | - | - | 592 B |
Append_Char | Job-ILDEMG | \compare\Core_Root\corerun.exe | 100 | 518.9 μs | NA | 518.9 μs | 518.9 μs | 518.9 μs | 0.92 | - | - | - | 592 B |
Append_Char | Job-AQYTDT | \baseline\Core_Root\corerun.exe | 100000 | 817.6 μs | NA | 817.6 μs | 817.6 μs | 817.6 μs | 1.00 | - | - | - | 210,016 B |
Append_Char | Job-ILDEMG | \compare\Core_Root\corerun.exe | 100000 | 631.9 μs | NA | 631.9 μs | 631.9 μs | 631.9 μs | 0.77 | - | - | - | 210,016 B |
Method | Job | Toolchain | length | Mean | Error | Median | Min | Max | Ratio | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Append_Char | Job-QIOYSB | \baseline\Core_Root\corerun.exe | 100 | 744.3 μs | NA | 744.3 μs | 744.3 μs | 744.3 μs | 1.00 | - | - | - | 592 B |
Append_Char | Job-IYIFDF | \compare\Core_Root\corerun.exe | 100 | 559.7 μs | NA | 559.7 μs | 559.7 μs | 559.7 μs | 0.75 | - | - | - | 592 B |
Append_Char | Job-QIOYSB | \baseline\Core_Root\corerun.exe | 100000 | 695.5 μs | NA | 695.5 μs | 695.5 μs | 695.5 μs | 1.00 | - | - | - | 210,016 B |
Append_Char | Job-IYIFDF | \compare\Core_Root\corerun.exe | 100000 | 734.5 μs | NA | 734.5 μs | 734.5 μs | 734.5 μs | 1.06 | - | - | - | 210,016 B |
I used the command in the "repro" section and added --corerun baseline\Core_Root\corerun.exe compare\Core_Root\corerun.exe
to it. Is that the right way to go @DrewScoggins?
I think the problem is that Append_Char is in fact just a noisy test that also happened to show a regression across this boundary. I would look at any of the others, besides System.Collections.CreateAddAndClear
Run Information
Regressions in System.Collections.Sort<Int32>
Historical Data in Reporting System
Repro
Run Information
Regressions in System.Threading.Tests.Perf_Timer
Historical Data in Reporting System
Repro
Run Information
Regressions in System.Collections.ContainsTrue<Int32>
Historical Data in Reporting System
Repro
Run Information
Regressions in System.Collections.CtorFromCollection<Int32>
Historical Data in Reporting System
Repro
Run Information
Regressions in System.Collections.TryGetValueFalse<Int32, Int32>
Historical Data in Reporting System
Repro
Run Information
Regressions in System.Collections.ContainsKeyTrue<Int32, Int32>
Historical Data in Reporting System
Repro
Run Information
Regressions in System.Text.Tests.Perf_StringBuilder
Historical Data in Reporting System
Repro
Run Information
Regressions in System.Collections.CreateAddAndClear<Int32>
Historical Data in Reporting System
Repro
Run Information
Regressions in System.Collections.ContainsKeyFalse<Int32, Int32>
Historical Data in Reporting System
Repro
Run Information
Regressions in Microsoft.Extensions.Primitives.StringSegmentBenchmark
Historical Data in Reporting System
Repro
Run Information
Regressions in System.Diagnostics.Perf_Process
Historical Data in Reporting System
Repro
Run Information
Regressions in System.Collections.TryGetValueTrue<Int32, Int32>
Historical Data in Reporting System
Repro
Run Information
Regressions in System.Collections.CreateAddAndClear<String>
Historical Data in Reporting System
Repro