Why is downloading in VSCode faster than using the terminal?

0
2
Asked By CuriousCoder99 On

I've noticed that downloading a file using VSCode seems to be significantly faster than running the same download script in the terminal. I'm using Invoke-WebRequest for both methods; it's the same script, just initiated from a GUI. Is this a known issue or an expected behavior?

3 Answers

Answered By DataDude101 On

How much faster are we talking? I did a quick test myself. I downloaded a file using both methods: VSCode took about 71 seconds, while the terminal took over 2050 seconds. That's a huge difference! It might be the way VSCode handles downloads compared to the terminal.

Answered By PowerShellNinja42 On

One reason could be the progress indicator in PowerShell, which can slow down the download. If you use `$ProgressPreference = 'SilentlyContinue'`, it turns off the progress notifications and might improve the speed. I found that both methods should perform similarly when the progress display isn't affecting I/O performance.

CodeHelper88 -

Interesting! How did you format that code block with the curly quotes? I've only seen standard single quotes before.

TechWhiz77 -

Yeah, I've heard that progress bars can really bog things down. I saw a method to update them less frequently, which helps a bit.

Answered By ScriptingNovice23 On

It's kinda strange, right? I noticed different speeds when using `Invoke-RestMethod`, `Invoke-WebRequest`, and `System.Net.WebClient`. In my last script, the WebClient was way faster — ten times faster, in fact. Anyone know why they vary so much?

PowerShellNerd01 -

I get what you mean; I’m just learning PowerShell myself!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.