Closed
Description
Repro Steps :
Compare perf of WebClient, BITS and Invoke-WebRequest:
Measure-Command { $wc = New-Object System.Net.WebClient; $wc.DownloadFile("https://github.com/dotnet/corefx/archive/master.zip", "C:\Users\crispop\Desktop\master.zip") }
Days : 0
Hours : 0
Minutes : 0
Seconds : 3
Milliseconds : 992
Ticks : 39928426
TotalDays : 4.62134560185185E-05
TotalHours : 0.00110912294444444
TotalMinutes : 0.0665473766666667
TotalSeconds : 3.9928426
TotalMilliseconds : 3992.8426
Vs
Measure-Command { Invoke-WebRequest "https://github.com/dotnet/corefx/archive/master.zip" -OutFile "C:\Users\crispop\Desktop\master.zip" }
Days : 0
Hours : 0
Minutes : 0
Seconds : 50
Milliseconds : 821
Ticks : 508212825
TotalDays : 0.000588209288194444
TotalHours : 0.0141170229166667
TotalMinutes : 0.847021375
TotalSeconds : 50.8212825
TotalMilliseconds : 50821.2825
Vs
Measure-Command { Start-BitsTransfer -Source "https://github.com/dotnet/corefx/archive/master.zip" -Destination "C:\Users\crispop\Desktop\masterBits2.zip" }
Days : 0
Hours : 0
Minutes : 0
Seconds : 4
Milliseconds : 506
Ticks : 45062594
TotalDays : 5.21557800925926E-05
TotalHours : 0.00125173872222222
TotalMinutes : 0.0751043233333333
TotalSeconds : 4.5062594
TotalMilliseconds : 4506.2594
Expected: Transfer speeds don't differ too much (maybe Invoke-WebRequest should be a bit faster than BITS which performs the transfer in background.)
Actual: 10x slowdown for Invoke-WebRequest