Skip to content

Add test to validate loaded assemblies and libraries on startup#8331

Closed
SteveL-MSFT wants to merge 5 commits intoPowerShell:masterfrom
SteveL-MSFT:startup-test
Closed

Add test to validate loaded assemblies and libraries on startup#8331
SteveL-MSFT wants to merge 5 commits intoPowerShell:masterfrom
SteveL-MSFT:startup-test

Conversation

@SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Nov 22, 2018

PR Summary

Assemblies loaded on startup impact startup time. Sometimes we merge a commit that uses a new type that adds loading a new assembly on startup. We need to catch these and decide if it's worth the impact or delay loading when possible. There's some in this list that appear like they can be delay loaded.

PR Checklist

@SteveL-MSFT SteveL-MSFT force-pushed the startup-test branch 14 times, most recently from f954c20 to 5d340e7 Compare November 23, 2018 06:42
@iSazonov iSazonov added the CL-Test Indicates that a PR should be marked as a test change in the Change Log label Nov 29, 2018
@SteveL-MSFT
Copy link
Member Author

seems that 'System.Collections.Immutable.dll' is still being loaded on startup

@SteveL-MSFT
Copy link
Member Author

'System.Security.Cryptography.Algorithms.dll' also is still being loaded

@SteveL-MSFT
Copy link
Member Author

'System.Security.Permissions.dll' is also being loaded on Windows

@daxian-dbw
Copy link
Member

Add-Type is the only place where immutable type is used. However, immutable.dll is loaded at startup even on my local Linux machine. There should be a dependency to it from .NET Core on Unix platforms.

For System.Security.Cryptography.Algorithms.dll and System.Security.Permissions.dll on Windows, I don't get them loaded locally. Let me take a look at what the CI does.

@daxian-dbw
Copy link
Member

daxian-dbw commented Dec 6, 2018

@SteveL-MSFT The additional loaded assemblies are resulted by the profile optimization configured in powershell. The file StartupProfileData-NonInteractive records assemblies that are potentially used right after powershell starts. With this file being available, powershell will eagerly load those assemblies using multiple CPU cores, even though some assemblies are not really needed for the current use case.

I updated the tests, and also made a change to correct the folder to store the 'StartupProfileData' files.
For convenience, I will just close this PR and submit a new one. The new PR is #8406.

@daxian-dbw daxian-dbw closed this Dec 6, 2018
@SteveL-MSFT SteveL-MSFT deleted the startup-test branch June 6, 2020 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-Test Indicates that a PR should be marked as a test change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Comments