Uh oh!
There was an error while loading. Please reload this page.
PGO: Profile isinst/castclass - #65460
Conversation
ghost
commented
Feb 16, 2022
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsThis PR adds class probes for some castclass/isinst operations in order to then optimize them in Tier1. I didn't push the change to utilize the PGO for cast/isinst because I want this to be merged first, then flow into our static pgo infrastructure (where I'll enable this flag) and collect isinst/castclass for Simple benchmark with the 2nd change (PGO is enabled): usingSystem.Runtime.CompilerServices;usingBenchmarkDotNet.Attributes;usingBenchmarkDotNet.Running;publicclassProgram2:Program{}publicclassProgram{publicstaticvoidMain(string[]args){BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args);}publicobject[]testData;[GlobalSetup]publicvoidSetup(){testData=newobject[1024];for(inti=0;i<testData.Length;i++)testData[i]=newProgram2();}[Benchmark]publicintCountPrograms(){vararray=testData;intcount=0;for(inti=0;i<array.Length;i++){if(array[i]isProgram)count++;}returncount;}[Benchmark]publicvoidCastPrograms(){vararray=testData;for(inti=0;i<array.Length;i++)Consume((Program)array[i]);}[MethodImpl(MethodImplOptions.NoInlining)]staticvoidConsume(Programp){}}
|
EgorBo
commented
Feb 16, 2022
/azp list |
This comment was marked as resolved.
This comment was marked as resolved.
EgorBo
commented
Feb 16, 2022
/azp run runtime-coreclr pgo, runtime-coreclr libraries-pgo |
|
Azure Pipelines successfully started running 2 pipeline(s). |
EgorBo
commented
Feb 16, 2022
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Andy Ayers <andya@microsoft.com>
This PR adds class probes for some castclass/isinst operations in order to then optimize them in Tier1.
These probes are only supposed to be run for static PGO since they add some overhead for the dynamic one and we want to avoid it, while for the static one we can afford some overhead for a training session.
I didn't push the change to utilize the PGO for cast/isinst because I want this to be merged first, then flow into our static pgo infrastructure (where I'll enable this flag) and collect isinst/castclass for
StandardOptimizationData.mibc. Then, I'll merge the second change and it will allow me to catch improvements properly for dotnet/performance.Simple benchmark with the 2nd change (PGO is enabled):