Programming-Language-Benchmarks icon indicating copy to clipboard operation
Programming-Language-Benchmarks copied to clipboard

Enable JIT features for C# performance

Open cl0ckt0wer opened this issue 2 years ago • 2 comments

Two options that can be enabled for long running processes. https://devblogs.microsoft.com/dotnet/performance_improvements_in_net_7/#jit

Profile Guided Optimizations: https://devblogs.microsoft.com/dotnet/conversation-about-pgo/

environment variables to set:

DOTNET_TieredPGO = 1 DOTNET_ReadyToRun = 0

note that DOTNET_TieredPGO doesn’t disable use of R2R images, so if you want the entirety of the core libraries also employing dynamic PGO, you’ll also need to set DOTNET_ReadyToRun=0

cl0ckt0wer avatar Mar 23 '23 07:03 cl0ckt0wer

Compilation Settings Reference https://learn.microsoft.com/en-us/dotnet/core/runtime-config/compilation

cl0ckt0wer avatar Mar 23 '23 07:03 cl0ckt0wer

"it’s now possible to simply put <TieredPGO>true</TieredPGO> into your .csproj, and it’ll have the same effect as if you set DOTNET_TieredPGO=1 prior to every invocation of the app, enabling dynamic PGO (note that it doesn’t disable use of R2R images, so if you want the entirety of the core libraries also employing dynamic PGO, you’ll also need to set DOTNET_ReadyToRun=0)."

igouy avatar Mar 24 '23 18:03 igouy