Skip to content

Get-Service is noticeably slower on PS7 than on WinPS5.1 #9871

Closed

Description

Steps to reproduce

Measure-Command { 1..100 | % { get-service sshd } }

Expected behavior

About the same time on both PS7 and WinPS 5.1

Actual behavior

WinPS5.1 took 100ms on my machine
PS7 took 532ms on same machine

Environment data

Name                           Value
----                           -----
PSVersion                      7.0.0-preview.1
PSEdition                      Core
GitCommitId                    7.0.0-preview.1
OS                             Microsoft Windows 10.0.18362
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Activity

  1. added
    Issue-Question
    Issue-Bug
    and removed
    Issue-Question
    on Jun 11, 2019
  2. iSazonov commented on Jun 13, 2019

    @iSazonov
    Collaborator

    My measure 526 vs 32

  3. iSazonov commented on Jun 13, 2019

    @iSazonov
    Collaborator

    It come from #4907 where we added properties (BinPath, Description, UserName and Delayed Auto Start).

    It seems the fix should be to move the properties to ETS and get its on demand only.

  4. kvprasoon commented on Jun 13, 2019

    @kvprasoon
    Contributor

    mine is (pwsh)32 Vs (powershell)1 ms

    
    Name                           Value
    ----                           -----
    PSVersion                      7.0.0-preview.1
    PSEdition                      Core
    GitCommitId                    7.0.0-preview.1
    OS                             Microsoft Windows 10.0.17134
    Platform                       Win32NT
    PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
    PSRemotingProtocolVersion      2.3
    SerializationVersion           1.1.0.1
    WSManStackVersion              3.0
    
  5. iSazonov commented on Jun 13, 2019

    @iSazonov
    Collaborator

    PRASOON KARUNAN V (@kvprasoon) I want to have your computer :-))))

  6. kvprasoon commented on Jun 13, 2019

    @kvprasoon
    Contributor

    Ilya (@iSazonov) , srry, I'll have to ask my manager... 😛

  7. KirkMunro commented on Aug 29, 2019

    @KirkMunro
    Contributor

    I just came across this code, where ETS types are added to Get-Service output, and since this issue is related, I wanted to ask a few questions:

    1. Why are the ETS type names prefixed with System.Service.ServiceController and not the actual System.ServiceProcess.ServiceController type? This seems incorrect.

    2. Why are we inserting custom type names for each added NoteProperty? I've used ETS very heavily over the past 12 years, and while I've identified an extended type using one custom ETS name, or perhaps several if I have a hierarchy like a class hierarchy, I've never added one ETS type name per property added. That feels redundant and unnecessary, and I think these types should either be removed or replaced with a single ETS type name of System.ServiceProcess.ServiceController#Extended.

    I know these should be logged as an additional issue or two, and I'll do that. I just want confirmation on the issues first since I don't have the background on why these were added with ETS names like this.

  8. iSazonov commented on Aug 30, 2019

    @iSazonov
    Collaborator

    Why are the ETS type names prefixed with System.Service.ServiceController and not the actual System.ServiceProcess.ServiceController type? This seems incorrect.

    It is tricky bug :-) - no automatic display but direct access works.

    For second, the intention was to use this in formatting system views. We could keep this if we make the properties "calculate-only-by-demand" for performance.

  9. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  10. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  11. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  12. added
    Resolution-No Activity
    on Nov 16, 2023
  13. microsoft-github-policy-service commented on Nov 23, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugResolution-No ActivityWG-Cmdlets

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions