Repository navigation
Closed
Labels
Resolution-FixedThe issue is fixed.WG-Cmdletsgeneral cmdlet issuesWaiting - DotNetCorewaiting on a fix/change in .NET
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
I am experiencing a performance issue with Invoke-Webrequest on PS 7.3.0-preview.6, compared to PS version 5.1 and 6 tested on Windows 10 and OSX.
Can be reproduced with the example URL below.
On PS 5.1 and 6 you get a return value after 1-2 seconds.
With PS 7 it takes around 70-80 seconds.
Reproducible on Windows 10 and OSX.
Please also see comparison videos.
Expected behavior
Invoke-WebRequest "https://www.libro.at/legor-30464-el-fuegos-stunt-kanone-polybag-30464-5702016668247.html" -Verbose
VERBOSE: GET https://www.libro.at/legor-30464-el-fuegos-stunt-kanone-polybag-30464-5702016668247.html
with 0-byte payload
VERBOSE: received 2586741-byte response of content type text/html
get a return value after 1-2 secondsActual behavior
Invoke-WebRequest "https://www.libro.at/legor-30464-el-fuegos-stunt-kanone-polybag-30464-5702016668247.html" -Verbose
VERBOSE: HTTP/1.1 GET with 0-byte payload
VERBOSE: received 2586741-byte response of content type text/html
get a return value after 70-80 secondsError details
Performance on PS7 is very slow compared to PS5.1 and PS6Environment data
Name Value
---- -----
PSVersion 7.3.0-preview.6
PSEdition Core
GitCommitId 7.3.0-preview.6
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.0Visuals
Metadata
Metadata
Assignees
Labels
Resolution-FixedThe issue is fixed.WG-Cmdletsgeneral cmdlet issuesWaiting - DotNetCorewaiting on a fix/change in .NET
Activity
iSazonov commentedon Jul 25, 2022
The issue appeared after moving to .Net 7.0.
/cc Steve Lee (@SteveL-MSFT) for information.
NoMoreFood commentedon Jul 25, 2022
Stefan Schmidhammer (@Terr4) Is this issue consistent across common MIME types for you? I am able to reproduce this, but not when
-OutFileis used so I'm guessing it's slowing down in the post-processing of the data.Terr4 commentedon Jul 25, 2022
I am only working with text/html responses, so unfortunately I cannot comment on other filetypes, but I also expected the postprocessing as the culprit so I tried -UseBasicParsing but without success.
I can confirm that it works very fast with -OutFile also on my side!
Just a note: The test url is not my server, so it can be that they do something to prevent such requests. However although it works very fast with versions PS5.1 and PS6
SteveL-MSFT commentedon Aug 1, 2022
This is quite interesting. Trying it out I see that the progress bar indicates the content is received and then it hangs for a bit before returning the result. Need to investigate what is happening between that time.
SteveL-MSFT commentedon Aug 1, 2022
Looks like the problem is that URL returns a large HTML page and the cmdlet is using a regex to try and find the charset. This takes a long time. I'm going to see if I can find an optimization.