New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve startup time by triggering initialization of additional types on background thread. #18195
base: master
Are you sure you want to change the base?
Conversation
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? |
|
On my notebook: BenchmarkDotNet=v0.13.2, OS=Windows 10 (10.0.19044.2006/21H2/November2021Update)
Intel Core i5-2410M CPU 2.30GHz (Sandy Bridge), 1 CPU, 4 logical and 2 physical cores
.NET SDK=7.0.100-rc.1.22431.12
[Host] : .NET 7.0.0 (7.0.22.42610), X64 RyuJIT AVX
DefaultJob : .NET 7.0.0 (7.0.22.42610), X64 RyuJIT AVX
Obviously server CPU with 12 Core win |
|
Thanks @daxian-dbw for continuing to add improvements to the startup time, a 30% improvements is awesome and almost unbelievable. |


PR Summary
Improve startup time by triggering initialization of additional types on background thread.
There are 2 changes:
Compiler,CachedReflectionInfo, andExpressionCache, which involves lots of reflection operations.LanguagePrimitivesandTypeAccelerators, because the former is needed earlier in the startup process.PR Context
The change improves the startup time of
pwsh.exeby about30%on my dev machine.The benchmark result below is from comparing "a release build with the change (V73Wip)" with "a release build without the change (V730)" (both has R2R images).
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.