Repository navigation
[mono][Perf] System.Tests.Perf_Type.GetType_Resolvers regression on 4/24/2024 9:24:37 PM #106402
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
PGOarch-arm64area-System.Reflection.Metadatabinaryformatter-migrationIssues related to the removal of BinaryFormatter and migrations away from itIssues related to the removal of BinaryFormatter and migrations away from itinvestigateos-linuxLinux OS (any supported distro)Linux OS (any supported distro)regression-from-last-releaseruntime-monospecific to the Mono runtimespecific to the Mono runtime
Milestone
Description
Run Information
| Name | Value |
|---|---|
| Architecture | arm64 |
| OS | ubuntu 22.04 |
| Queue | AmpereUbuntu |
| Baseline | edb6e7c154a4a75c8d1430cd6a996e6f1f9b401e |
| Compare | 74d927967dcf9dc1801c310603d6dc843dc28ad6 |
| Diff | Diff |
| Configs | CompilationMode:tiered, LLVM:true, MonoAOT:true, MonoInterpreter:false, RunKind:micro_mono |
Regressions in System.Tests.Perf_Type
| Benchmark | Baseline | Test | Test/Base | Test Quality | Edge Detector | Baseline IR | Compare IR | IR Ratio |
|---|---|---|---|---|---|---|---|---|
| 1.19 μs | 1.37 μs | 1.15 | 0.31 | False |
Repro
General Docs link: https://github.com/dotnet/performance/blob/main/docs/benchmarking-workflow-dotnet-runtime.md
Repro Steps
Prerequisites (Files either built locally (with build.(sh/cmd) or downloaded from payload above (if same system setup) (in this order))
- Libraries build extracted to
runtime/artifactsor build instructions: Libraries README args:-subset libs+libs.tests -rc release -configuration Release -arch $RunArch -framework net8.0 - CoreCLR product build extracted to
runtime/artifacts/bin/coreclr/$RunOS.$RunArch.Release, build instructions: CoreCLR README args:-subset clr+libs -rc release -configuration Release -arch $RunArch -framework net8.0 - AOT MONO build extracted to
runtime/artifacts/bin/mono/$RunOS.$RunArch.Release, build instructions: MONO README args:-arch $RunArch -os $RunOS -s mono+libs+host+packs -c Release /p:CrossBuild=false /p:MonoLLVMUseCxx11Abi=false - Dotnet SDK installed for dotnet commands
- Running commands from the runtime folder
Linux
# Set $RunDir to the runtime directory
RunDir=`pwd`
# Set the OS, arch, and OSId
RunOS='linux'
RunOSId='linux'
RunArch='x64'
# Create aot directory
mkdir -p $RunDir/artifacts/bin/aot/sgen
mkdir -p $RunDir/artifacts/bin/aot/pack
cp -r $RunDir/artifacts/obj/mono/$RunOS.$RunArch.Release/mono/* $RunDir/artifacts/bin/aot/sgen
cp -r $RunDir/artifacts/bin/microsoft.netcore.app.runtime.$RunOS-$RunArch/Release/* $RunDir/artifacts/bin/aot/pack
# Create Core Root
$RunDir/src/tests/build.sh release $RunArch generatelayoutonly /p:LibrariesConfiguration=Release
# Clone performance
git clone --branch main --depth 1 --quiet https://github.com/dotnet/performance.git $RunDir/performance
# One line run:
python3 $RunDir/performance/scripts/benchmarks_ci.py --csproj $RunDir/performance/src/benchmarks/micro/MicroBenchmarks.csproj --incremental no --architecture $RunArch -f net8.0 --filter 'System.Tests.Perf_Type*' --bdn-artifacts $RunDir/artifacts/BenchmarkDotNet.Artifacts --bdn-arguments="--anyCategories Libraries Runtime --category-exclusion-filter NoAOT NoWASM --runtimes monoaotllvm --aotcompilerpath $RunDir/artifacts/bin/aot/sgen/mini/mono-sgen --customruntimepack $RunDir/artifacts/bin/aot/pack --aotcompilermode llvm --logBuildOutput --generateBinLog"
# Individual Commands:
# Restore
dotnet restore $RunDir/performance/src/benchmarks/micro/MicroBenchmarks.csproj --packages $RunDir/performance/artifacts/packages /p:UseSharedCompilation=false /p:BuildInParallel=false /m:1
# Build
dotnet build $RunDir/performance/src/benchmarks/micro/MicroBenchmarks.csproj --configuration Release --framework net8.0 --no-restore /p:NuGetPackageRoot=$RunDir/performance/artifacts/packages /p:UseSharedCompilation=false /p:BuildInParallel=false /m:1
# Run
dotnet run --project $RunDir/performance/src/benchmarks/micro/MicroBenchmarks.csproj --configuration Release --framework net8.0 --no-restore --no-build -- --filter System.Tests.Perf_Type* --anyCategories Libraries Runtime " --category-exclusion-filter NoAOT NoWASM --runtimes monoaotllvm --aotcompilerpath $RunDir/artifacts/bin/aot/sgen/mini/mono-sgen --customruntimepack $RunDir/artifacts/bin/aot/pack --aotcompilermode llvm --logBuildOutput --generateBinLog " --artifacts $RunDir/artifacts/BenchmarkDotNet.Artifacts --packages $RunDir/performance/artifacts/packages --buildTimeout 1200Windows
# Set $RunDir to the runtime directory
$RunDir="FullPathHere"
# Set the OS, arch, and OSId
RunOS='windows'
RunOSId='win'
RunArch='x64'
# Create aot directory
mkdir $RunDir\artifacts\bin\aot\sgen
mkdir $RunDir\artifacts\bin\aot\pack
xcopy $RunDir\artifacts\obj\mono\$RunOS.$RunArch.Release\mono $RunDir\artifacts\bin\aot\sgen\ /e /y
xcopy $RunDir\artifacts\bin\microsoft.netcore.app.runtime.$RunOSId-$RunArch\Release $RunDir\artifacts\bin\aot\pack\ /e /y
# Create Core Root
$RunDir\src\tests\build.cmd release $RunArch generatelayoutonly /p:LibrariesConfiguration=Release
# Clone performance
git clone --branch main --depth 1 --quiet https://github.com/dotnet/performance.git $RunDir\performance
# One line run:
python3 $RunDir\performance\scripts\benchmarks_ci.py --csproj $RunDir\performance\src\benchmarks\micro\MicroBenchmarks.csproj --incremental no --architecture $RunArch -f net8.0 --filter 'System.Tests.Perf_Type*' --bdn-artifacts $RunDir\artifacts\BenchmarkDotNet.Artifacts --bdn-arguments="--anyCategories Libraries Runtime --category-exclusion-filter NoAOT NoWASM --runtimes monoaotllvm --aotcompilerpath $RunDir\artifacts\bin\aot\sgen\mini\mono-sgen.exe --customruntimepack $RunDir\artifacts\bin\aot\pack --aotcompilermode llvm --logBuildOutput --generateBinLog"
# Individual Commands:
# Restore
dotnet restore $RunDir\performance\src\benchmarks\micro\MicroBenchmarks.csproj --packages $RunDir\performance\artifacts\packages /p:UseSharedCompilation=false /p:BuildInParallel=false /m:1
# Build
dotnet build $RunDir\performance\src\benchmarks\micro\MicroBenchmarks.csproj --configuration Release --framework net8.0 --no-restore /p:NuGetPackageRoot=$RunDir\performance\artifacts\packages /p:UseSharedCompilation=false /p:BuildInParallel=false /m:1
# Run
dotnet run --project $RunDir\performance\src\benchmarks\micro\MicroBenchmarks.csproj --configuration Release --framework net8.0 --no-restore --no-build -- --filter System.Tests.Perf_Type* --anyCategories Libraries Runtime " --category-exclusion-filter NoAOT NoWASM --runtimes monoaotllvm --aotcompilerpath $RunDir\artifacts\bin\aot\sgen\mini\mono-sgen.exe --customruntimepack $RunDir\artifacts\bin\aot\pack -aotcompilermode llvm --logBuildOutput --generateBinLog " --artifacts $RunDir\artifacts\BenchmarkDotNet.Artifacts --packages $RunDir\performance\artifacts\packages --buildTimeout 1200Details
System.Tests.Perf_Type.GetType_Resolvers(input: typeof(System.Tests.Nested))
ETL Files
Histogram
JIT Disasms
Docs
Profiling workflow for dotnet/runtime repository
Benchmarking workflow for dotnet/runtime repository
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
PGOarch-arm64area-System.Reflection.Metadatabinaryformatter-migrationIssues related to the removal of BinaryFormatter and migrations away from itIssues related to the removal of BinaryFormatter and migrations away from itinvestigateos-linuxLinux OS (any supported distro)Linux OS (any supported distro)regression-from-last-releaseruntime-monospecific to the Mono runtimespecific to the Mono runtime

Activity
matouskozak commentedon May 7, 2024
The range of regression is d92ac1f...5b4e770. Could it be the library changes from #100094 @adamsitnik ?
matouskozak commentedon Jun 27, 2024
@adamsitnik do you think it could be related to #100094?
kotlarmilos commentedon Aug 1, 2024
This looks like noise.
dotnet-policy-service commentedon Aug 14, 2024
Tagging subscribers to this area: @directhex, @matouskozak
See info in area-owners.md if you want to be subscribed.
dotnet-policy-service commentedon Aug 14, 2024
Tagging subscribers to this area: @dotnet/area-system-reflection-metadata
See info in area-owners.md if you want to be subscribed.
matouskozak commentedon Aug 14, 2024
I think this could be a real regression based on the trend:

@adamsitnik do you think that your change #100094 could have caused this?
[-][Perf] Linux/arm64: 1 Regression on 4/24/2024 9:24:37 PM[/-][+][mono][Perf] System.Tests.Perf_Type.GetType_Resolvers regression on 4/24/2024 9:24:37 PM[/+]dotnet-policy-service commentedon Aug 19, 2024
Tagging subscribers to 'binaryformatter-migration': @adamsitnik, @bartonjs, @jeffhandley, @terrajobst
ericstj commentedon Aug 28, 2024
@adamsitnik it seems this is a regression in GetType from the type name parser changes. Could you please have a look?
adamsitnik commentedon Aug 29, 2024
Yes, this is related to
TypeNameparser changes. The parser got unified for CLR, Mono and NativeAOT. In most cases, it's faster:https://pvscmdupload.z22.web.core.windows.net/reports/allTestHistory/refs/heads/main_x64_ubuntu%2022.04_LLVM%3dfalse_MonoAOT%3dfalse_MonoInterpreter%3dfalse_RunKind%3dmicro_mono/System.Tests.Perf_Type.GetType_Resolvers(input%3a%20typeof(int)).html
https://pvscmdupload.z22.web.core.windows.net/reports/allTestHistory/refs/heads/main_x64_ubuntu%2022.04_LLVM%3dfalse_MonoAOT%3dfalse_MonoInterpreter%3dfalse_RunKind%3dmicro_mono/System.Tests.Perf_Type.GetType_Resolvers(input%3a%20typeof(System.Tests.Nested)).html
https://pvscmdupload.z22.web.core.windows.net/reports/allTestHistory/refs/heads/main_x64_ubuntu%2022.04_LLVM%3dfalse_MonoAOT%3dfalse_MonoInterpreter%3dfalse_RunKind%3dmicro_mono/System.Tests.Perf_Type.GetType_Resolvers(input%3a%20typeof(System.Int32%5b%5d)).html
The last image is Mono x64 Ubuntu same benchmark as the one reported here and as you can see it has improved. So there must be something in Mono arm64 AOT codegen that makes it slower. Since parsing nested types is rather a niche scenario I believe it's fair to say it's a good tradeoff (unified parser & a lot of perf improvements) and close the issue.