Enable JIT features for C# performance
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
Compilation Settings Reference https://learn.microsoft.com/en-us/dotnet/core/runtime-config/compilation
"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)."