Anyway to isolate Dynamic PGO impact? #2332
-
Great lib and great idea to have discussions open here on GH 👍🏻I see Dynamic PGO is enabled by default in .NET 8. Is Dynamic PGO handled / How is Dynamic PGO handled in BenchmarkDotNet? If I'm running a benchmark for say some kind string concat in .NET 7 v .NET 8 and I get certain results does that include Dynamic PGO improvement or is the PGO impact removed from displayed results? Would love to know more about how (and if) DPGO is handled in BDN |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
You can turn on the PGO flags using a configuration. To turn on for all benchmarks, use the following var config = DefaultConfig.Instance
.AddJob(Job.Default
.WithRuntime(CoreRuntime.Core60)
.WithEnvironmentVariables(
new EnvironmentVariable("DOTNET_ReadyToRun", "0"), // Disable AOT
new EnvironmentVariable("DOTNET_TC_QuickJitForLoops", "1"), // Enable Quick Jit for loop
new EnvironmentVariable("DOTNET_TieredPGO", "1")) // Turn on layered PGO
.WithId(".NET 6 PGO"); The flags are set as specified at https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-6/ |
Beta Was this translation helpful? Give feedback.
-
By default, BDN results for .NET 8 (preview 5 and later) will include Dynamic PGO. To disable this you can set If your |
Beta Was this translation helpful? Give feedback.
-
Thanks Andy ... Can DPGO make performance worse, or am I doing something stupid here ... Benchmark -> |
Beta Was this translation helpful? Give feedback.
-
Great, thanks a lot for your help Andy, I just wasn't sure if it was my with my setup ...
or I was successfully isolating DPGO affect and seeing some regressions .. |
Beta Was this translation helpful? Give feedback.
You can turn on the PGO flags using a configuration. To turn on for all benchmarks, use the following
config
as a parameter for yourBenchmarkSwitcher
:The flags are set as specified at https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-6/