Skip to content

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

Closed
Steve Lee (SteveL-MSFT) wants to merge 5 commits into
PowerShell:masterfrom
SteveL-MSFT:startup-test
Closed

Steve Lee (SteveL-MSFT) wants to merge 5 commits into
PowerShell:masterfrom
SteveL-MSFT:startup-test

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Nov 22, 2018 •

Copy link
Copy Markdown
Member

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

Comment thread test/powershell/Host/Startup.Tests.ps1 Resolved
@iSazonov Ilya (iSazonov) added the CL-Test Indicates that a PR should be marked as a test change in the Change Log label Nov 29, 2018
Comment thread test/powershell/Host/Startup.Tests.ps1 Resolved
Comment thread test/powershell/Host/Startup.Tests.ps1 Resolved
Comment thread test/powershell/Host/Startup.Tests.ps1 Resolved
@SteveL-MSFT

Copy link
Copy Markdown
Member Author

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

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

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

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

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

@daxian-dbw

Copy link
Copy Markdown
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

Dongbo Wang (daxian-dbw) commented Dec 6, 2018 •

Copy link
Copy Markdown
Member

Steve Lee (@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.

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