Strange slow piping to out-gridview

Welcome Forums General PowerShell Q&A Strange slow piping to out-gridview

This topic contains 8 replies, has 5 voices, and was last updated by

 
Participant
2 years, 10 months ago.

  • Author
    Posts
  • #28526

    Participant
    Points: 1
    Rank: Member

    Hello

    I've got a strange behavior:
    newly installed Windows 7 SP1
    upgraded PowerShell to 4.0

    `
    Measure-Command {
    1..10
    }

    Days : 0
    Hours : 0
    Minutes : 0
    Seconds : 0
    Milliseconds : 6
    Ticks : 68685
    TotalDays : 7,94965277777778E-08
    TotalHours : 1,90791666666667E-06
    TotalMinutes : 0,000114475
    TotalSeconds : 0,0068685
    TotalMilliseconds : 6,8685

    `

    `
    Measure-Command {
    Out-GridView
    }

    Days : 0
    Hours : 0
    Minutes : 0
    Seconds : 0
    Milliseconds : 1
    Ticks : 17251
    TotalDays : 1,99664351851852E-08
    TotalHours : 4,79194444444444E-07
    TotalMinutes : 2,87516666666667E-05
    TotalSeconds : 0,0017251
    TotalMilliseconds : 1,7251
    `

    BUT:
    `
    Measure-Command {
    1..10 | Out-GridView
    }

    Days : 0
    Hours : 0
    Minutes : 0
    Seconds : 30
    Milliseconds : 377
    Ticks : 303771673
    TotalDays : 0,000351587584490741
    TotalHours : 0,00843810202777778
    TotalMinutes : 0,506286121666667
    TotalSeconds : 30,3771673
    TotalMilliseconds : 30377,1673

    `

    any ideas why piping takes soooo loong?

  • #28532

    Member
    Points: 0
    Rank: Member

    Weird. That takes less than a second on my Windows 10 box. Not sure what's going on there with your versions / system.

  • #28560

    Participant
    Points: 0
    Rank: Member

    I ran this test a series of times in succession using Measure-Object, then counted the average number for seconds and milliseconds among all the Measure-Object runs. This was on a Windows 8.1 x64 machine with PS4.0

    $Seconds = @()
    $Milliseconds = @()
    $MaxRuns = 10;
    
    foreach($i in 1..$MaxRuns)
    {
        $e = Measure-Command {1..10 | Out-GridView}
        $Seconds += $e.Seconds
        $Milliseconds += $e.Milliseconds
    }
    Write-Host "Average number of seconds among $MaxRuns runs:  "+ $($Seconds | Measure-Object -Average).Average
    Write-Host "Average number of milliseconds among $MaxRuns runs: " +  $($Milliseconds | Measure-Object -Average).Average
    

    My results:
    Average number of seconds among 10 runs: + 0
    Average number of milliseconds among 10 runs: + 54.1

  • #28604

    Participant
    Points: 1
    Rank: Member

    results on my machine:

    Average number of seconds among 10 runs: + 30
    Average number of milliseconds among 10 runs: + 329,7

  • #29702

    Participant
    Points: 0
    Rank: Member

    I find myself having the same issue for the last few days. I am Win7 SP1 (x64), but also seeing the same behavior from (some) servers too? Here are my results:

    Average number of seconds among 10 runs: + 30
    Average number of milliseconds among 10 runs: + 206.2

    It is annoying because I use out-gridview constantly. Something definitely changed. Anyone figure out what?

  • #29704

    Participant
    Points: 0
    Rank: Member
    $Names=@()
    Get-TraceSource | select Name | foreach {$Names += $_.Name.Trim()} 
    Trace-Command -Name $Names -Expression {1..10 | Out-GridView} -PSHost -Option All
     
     
     
    

    My Result:

    For me the freeze is happening between these two lines:

    DEBUG: ParameterBinding Information: 0 : MANDATORY PARAMETER CHECK on cmdlet [Out-GridView]
    DEBUG: ParameterBinding Information: 0 : BIND PIPELINE object to parameters: [Out-GridView]

  • #30468

    Participant
    Points: 0
    Rank: Member

    Same issue here – Win7 SP1 (x64). Did anyone find a fix?

  • #34934

    Participant
    Points: 0
    Rank: Member

    Not yet and what is maddening is that it is randomly fast? Like sometimes after a fresh boot they come up quickly once or twice? Very strange.

  • #34936

    Participant
    Points: 0
    Rank: Member

    Added a note about this on uservoice:

    https://windowsserver.uservoice.com/forums/301869-powershell/suggestions/12130563-slow-piping-to-out-gridview

    If you are experiencing this please go vote for it, so someone looks at it? Just need someone to ask the right question so we can get this resolved.

    Thanks

The topic ‘Strange slow piping to out-gridview’ is closed to new replies.