-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Generated the AssemblyRecord code in AssemblyHelper to improve startup performance #7033
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
Generated the AssemblyRecord code in AssemblyHelper to improve startup performance #7033
Conversation
|
/azp run |
|
No pipelines are associated with this pull request. |
|
@lindexi, this PR looks good, but our only concern with this PR is that hard-coding the list will make the maintenance harder. Thoughts? |
|
Thank you @dipeshmsft I agree with you. But I don't think it's possible to add new assemblies. In other words, this is the constant. |
|
Thanks @lindexi for your contributions in performance. |
Why do you think so? They have been changed in the past, cf. https://referencesource.microsoft.com/#WindowsBase/Base/MS/Internal/AssemblyHelper.cs,d11803a9eea58251 |
|
@miloush What is |
|
@lindexi "confer", means compare - as in the list of assemblies is now different than it was in .NET Framework. |
|
@miloush Thank you. You are right. Can I ask you for advice? |
|
Well the fact that they are both in the same file helps a bit with the maintenance. I would have put a comment on the enum that the static AssemblyHelper constructor needs to be updated when changes are done to the enum or vice versa. Also why didn't you just do _records = new AssemblyRecord[5];
_records[0].Name = "System.Drawing.Common,";
_records[1].Name = "System.Private.Xml,";
...However since this is merged now, I guess you can leave it be. |
Description
The AssemblyHelper will create the
AssemblyRecord[]by UncommonAssembly. And the code will be run when the application startup.And I think it's worth doing this optimization to improve startup performance. And I don't think these Uncommon Assembly will be added or changed.
Benchmark result:
Benchmark code: https://github.com/lindexi/lindexi_gd/blob/7d0d7d5a5bbd12b67480413a17bc43197454b54a/KairfeefaqaiJeaqenuna/KairfeefaqaiJeaqenuna/Program.cs
Customer Impact
Slightly slow startup performance issues.
Regression
None.
Testing
Just CI and the benchmark code.
Risk
Very low. The code is changed equivalently. No behavior was changed.
Microsoft Reviewers: Open in CodeFlow