Skip to content

Invoke-WebRequest extremely slow in pscore 7.2.5 compared with ps 5.1.19041.1682 by order of 20x #17893

Closed

Description

@AAATechGuy

Prerequisites

Steps to reproduce

On the same machine, Invoke-WebRequest performance is extremely slow in pscore 7.2.5 compared with ps 5.1.19041.1682, by order of 20x. 67 ms vs 1054 ms, on repeated tries.

Expected behavior

faster on ps 5.1.19041.1682 on repeated tries.

> $PSVersionTable

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


> $AzureDevOpsAuthenicationHeader = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":$($env:AbinzPAT)")) };

> $ProgressPreference = 'SilentlyContinue'

> measure-command { Invoke-WebRequest -Uri 'https://dev.azure.com/msasg/Bing_Ads/_apis/git/repositories/8bb57295-40ed-49d8-aa31-e4c852c49dde/items//private/Deployer/tools/BingAdsDevOpsUtils/BingAdsDevOpsUtils.psd1?versionType=Branch&version=master&versionOptions=None' -Method Get -Headers $AzureDevOpsAuthenicationHeader -OutFile 'C:\Users\abinaa\AppData\Local\Temp\test_BingAdsLinuxVm.psd1' -TimeoutSec 30 }



Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 0
Milliseconds      : 67
Ticks             : 678216
TotalDays         : 7.84972222222222E-07
TotalHours        : 1.88393333333333E-05
TotalMinutes      : 0.00113036
TotalSeconds      : 0.0678216
TotalMilliseconds : 67.8216

Actual behavior

on the same machine, much slower on pscore 7.2.5 on repeated tries.
This issue compounds on multiple calls, for e.g., download 1000 files.

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.2.5
PSEdition                      Core
GitCommitId                    7.2.5
OS                             Microsoft Windows 10.0.19044
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

> $AzureDevOpsAuthenicationHeader = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":$($env:AbinzPAT)")) };

> $ProgressPreference = 'SilentlyContinue'

> measure-command { Invoke-WebRequest -Uri 'https://dev.azure.com/msasg/Bing_Ads/_apis/git/repositories/8bb57295-40ed-49d8-aa31-e4c852c49dde/items//private/Deployer/tools/BingAdsDevOpsUtils/BingAdsDevOpsUtils.psd1?versionType=Branch&version=master&versionOptions=None' -Method Get -Headers $AzureDevOpsAuthenicationHeader -OutFile 'C:\Users\abinaa\AppData\Local\Temp\test_BingAdsLinuxVm.psd1' -TimeoutSec 30 }


Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 1
Milliseconds      : 54
Ticks             : 10544699
TotalDays         : 1.22045127314815E-05
TotalHours        : 0.000292908305555556
TotalMinutes      : 0.0175744983333333
TotalSeconds      : 1.0544699
TotalMilliseconds : 1054.4699

Error details

No response

Environment data

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.2.5
PSEdition                      Core
GitCommitId                    7.2.5
OS                             Microsoft Windows 10.0.19044
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Activity

  1. added
    Needs-Triage
    on Aug 13, 2022
  2. changed the title [-]Invoke-WebRequest extremely slow in pscore 7.2.5 compared with ps 5.1.19041.1682[/-] [+]Invoke-WebRequest extremely slow in pscore 7.2.5 compared with ps 5.1.19041.1682 by order of 20x[/+] on Aug 13, 2022
  3. iSazonov commented on Aug 14, 2022

    @iSazonov
    Collaborator

    Dup #17762 and #16685. Fix in work #17813

  4. ghost added
    In-PR
    on Aug 14, 2022
  5. AAATechGuy commented on Aug 14, 2022

    @AAATechGuy
    ContributorAuthor

    Ilya (@iSazonov) , don't think the fix you mentioned would help. I sent a proposal for fix.

    Steve Lee (@SteveL-MSFT), help review.

  6. removed
    Resolution-Duplicate
    on Aug 14, 2022
  7. ghost removed
    In-PR
    on Aug 18, 2022
  8. ghost added
    In-PR
    on Aug 18, 2022
  9. ghost removed
    In-PR
    on Aug 23, 2022
  10. ghost added
    Resolution-Fixed
    on Aug 23, 2022
  11. ghost removed
    Needs-Triage
    on Aug 23, 2022
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

    Resolution-FixedWG-Cmdlets

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions