Skip to content

Beta.9 - Invoke-WebRequest speed seems slow compare to Windows version but is not. #5284

@MaximoTrinidad

Description

@MaximoTrinidad

Compare execution of downloading a file using Invoke-WebRequest in both Windows PowerShell and PowerShell Core Beta.9. Beta.9 seems slower than Windows but is not. The progress bar in PowerShell Core is refreshing slower but in fact the process runs faster in Beta.9.

Steps to reproduce

Execute following command below in both Windows and PowerShell Beta.9:

Measure-Command {Invoke-WebRequest -Uri "https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/PowerShell-6.0.0-beta.9-win-x86.msi" -OutFile C:\Users\max_t\Downloads\PowerShell-6.0.0-beta.9-win-x86.msi}

Expected behavior

Visually seems processing speed should be the same if executing the command on the same system.

Actual behavior

PowerShell Core Beta,9 progress bar refresh is a bit slower then Windows PowerShell.
But, the end results is that PowerShell Core Beta.9 runs a bit faster than Windows PowerShell.

## - Windows PowerShell 5.1 resutls:
PS C:\Users\max_t> Measure-Command {Invoke-WebRequest -Uri "https://github.com/PowerShell/PowerShell/releases/download/v
6.0.0-beta.9/PowerShell-6.0.0-beta.9-win-x86.msi" -OutFile C:\Users\max_t\Downloads\PowerShell-6.0.0-beta.9-win-x86.msi}

Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 34
Milliseconds      : 777
Ticks             : 347771486
TotalDays         : 0.000402513293981481
TotalHours        : 0.00966031905555556
TotalMinutes      : 0.579619143333333
TotalSeconds      : 34.7771486
TotalMilliseconds : 34777.1486

## - PowerShell Core Beta.9 results:
PS C:\Program Files\PowerShell\6.0.0-beta.9> Measure-Command {Invoke-WebRequest -Uri "https://github.com/PowerShell/PowerShell/releases/download/v
6.0.0-beta.9/PowerShell-6.0.0-beta.9-win-x86.msi" -OutFile C:\Users\max_t\Downloads\PowerShell-6.0.0-beta.9-win-x86.msi}

Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 7
Milliseconds      : 942
Ticks             : 79426444
TotalDays         : 9.19287546296296E-05
TotalHours        : 0.00220629011111111
TotalMinutes      : 0.132377406666667
TotalSeconds      : 7.9426444
TotalMilliseconds : 7942.6444

Environment data

PS C:\Program Files\PowerShell\6.0.0-beta.9> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.0.0-beta.9
PSEdition                      Core
GitCommitId                    v6.0.0-beta.9
OS                             Microsoft Windows 10.0.16299
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

PS C:\Users\max_t> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.16299.15
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.16299.15
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

webrequest_05_2017-11-01_0-54-18

webrequest_04_2017-11-01_0-54-18

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-By DesignThe reported behavior is by design.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions