Skip to content
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

Fix perf issue using WSMan provider or Get-PSSessionConfiguration #7680

Merged

Conversation

SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Aug 31, 2018

PR Summary

.NET Core introduced a perf regression during instantiation of ServiceController which is used by the WSMan Config Provider to check if WinRM is running as it depends on WinRM to get configuration information.

Instead of creating new instance of ServiceController every time we need to check WinRM service status. We can create it just once and use the Refresh() method on the instance to get latest status information. This brings the perf back to comparable to Windows PowerShell.

Prior to this change, Windows PowerShell calling Get-PSSessionConfiguration took ~3 secs and PSCore6.1 took ~14 secs. After this change, PSCore6.1 took ~4 secs.

PR Checklist

…ther than instantiating ServiceController which has a significant perf degradation from .NET Framework
Copy link
Contributor

@PaulHigin PaulHigin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adityapatwardhan adityapatwardhan merged commit b99fde0 into PowerShell:master Sep 4, 2018
@SteveL-MSFT SteveL-MSFT deleted the wsman-provider-perf branch September 4, 2018 17:07
TravisEz13 pushed a commit that referenced this pull request Sep 5, 2018
…ther than instantiating ServiceController which has a significant perf degradation from .NET Framework (#7680)
@TravisEz13 TravisEz13 added this to the v6.1.0 milestone Sep 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants