Skip to content

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

Merged
Aditya Patwardhan (adityapatwardhan) merged 1 commit into
PowerShell:masterfrom
SteveL-MSFT:wsman-provider-perf
Sep 4, 2018
Merged

Fix perf issue using WSMan provider or Get-PSSessionConfiguration#7680
Aditya Patwardhan (adityapatwardhan) merged 1 commit into
PowerShell:masterfrom
SteveL-MSFT:wsman-provider-perf

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Aug 31, 2018

Copy link
Copy Markdown
Member

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

Choose a reason for hiding this comment

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

LGTM

@adityapatwardhan
Aditya Patwardhan (adityapatwardhan) merged commit b99fde0 into PowerShell:master Sep 4, 2018
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the wsman-provider-perf branch September 4, 2018 17:07
Travis Plunk (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 Travis Plunk (TravisEz13) added this to the v6.1.0 milestone Sep 7, 2018
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
…ther than instantiating ServiceController which has a significant perf degradation from .NET Framework (PowerShell#7680)
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
…ther than instantiating ServiceController which has a significant perf degradation from .NET Framework (PowerShell#7680)
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