Здравствуйте, _NN_, Вы писали:
_NN>Попробуйте с Ready2Run, должно чуть улучшить.
PS C:\tmp\ProbaConsole\net8> dotnet publish -c Release -r win-x64 -p:PublishReadyToRun=true
PS C:\tmp\ProbaConsole> .\WinTime64.exe C:\tmp\ProbaConsole\net8\bin\Release\net8.0\win-x64\publish\net8.exe
Hello!
PageFaultCount: 4333
PeakWorkingSetSize: 15.72 MiB
QuotaPeakPagedPoolUsage: 160.5 KiB
QuotaPeakNonPagedPoolUsage: 15.01 KiB
PeakPagefileUsage: 5.215 MiB
Creation time 2024/01/18 10:29:56.999
Exit time 2024/01/18 10:29:57.064
Wall time: 0 days, 00:00:00.064 (0.06 seconds)
User time: 0 days, 00:00:00.015 (0.02 seconds)
Kernel time: 0 days, 00:00:00.046 (0.05 seconds)
PS C:\tmp\ProbaConsole> .\WinTime64.exe .\net4\Program.exe
Hello!
PageFaultCount: 2990
PeakWorkingSetSize: 10.84 MiB
QuotaPeakPagedPoolUsage: 173.8 KiB
QuotaPeakNonPagedPoolUsage: 11.66 KiB
PeakPagefileUsage: 8.898 MiB
Creation time 2024/01/18 10:30:03.312
Exit time 2024/01/18 10:30:03.359
Wall time: 0 days, 00:00:00.046 (0.05 seconds)
User time: 0 days, 00:00:00.046 (0.05 seconds)
Kernel time: 0 days, 00:00:00.000 (0.00 seconds)
после прогрева, первый запуск все равно порядка 2х секунд