PGO vs AOT, which should I use? #74940
-
Hello, I read the blog post on Performance Improvements in .NET 7 and I am trying to better understand PGO and AOT. From what I understood, in broad lines:
Is that it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Correct, it's a bit slower to start because of instrumentation in Tier0. We try to minimize that effect in .NET 8.0 e.g. via #70941 where we will be instrumenting only hot tier0 code. Also, we try to reduce overhead from instrumentation in general or/and enable some quick opts in tier0. In .NET 6.0-7.0, for better effect from PGO you need to disable R2R via
Depends on what kind of AOT you mean, if it's NativeAOT then yes - fast start, small app, no self-tunning. So In .NET 7.0 and older I'd say use NativeAOT or R2R everywhere where start time matters and enable PGO if you need better stable-state performance. |
Beta Was this translation helpful? Give feedback.
Correct, it's a bit slower to start because of instrumentation in Tier0. We try to minimize that effect in .NET 8.0 e.g. via #70941 where we will be instrumenting only hot tier0 code. Also, we try to reduce overhead from instrumentation in general or/and enable some quick opts in tier0.
In .NET 6.0-7.0, for better effect from PGO you need to disable R2R via
DOTNET_ReadyToRun=0
so all the code executed on start will have to jitted from scratch - it affects start time badlyDepends on what kind of AOT you mean, if it's N…