WSL icon indicating copy to clipboard operation
WSL copied to clipboard

untar is very slow

Open kanigsson opened this issue 10 years ago • 6 comments

Hello,

First things first: I tried the WSL today for the first time, and I'm very impressed, I could replicate part of my current VirtualBox + Ubuntu setup without a single error.

One thing I noticed in that process is that "tar" is slow when unpacking archives. Just as an example, I tried to untar the latest linux archive using "tar Jxf ". In virtualbox, this takes only 10 seconds, in WSL it's more like 10 minutes, so I think something is wrong.

Is that something others experience as well?

kanigsson avatar Jun 11 '16 05:06 kanigsson

I've found that the antivirus (windows defender) have a great impact on file performance on my system. I use no other antivirus.

So I've added an exclusion in windows defender on my system

  • launch cmd and type echo %LOCALAPPDATA%\lxss
  • cut the resulting directory
  • go to settings/security/windows defender and add a folder exclusion with the folder you cutted in cmd

Could you tell if untar is faster aftter that ?

o-g-o avatar Jun 11 '16 07:06 o-g-o

Thank you for that tip. Yes, that actually helped a lot - untar now is 5 times faster than before! I measured roughly 2 minutes instead of 10 for unpacking that archive after adding that folder exclusion. Definitely better, although there still is a lot of room for improvement.

kanigsson avatar Jun 12 '16 02:06 kanigsson

Does your tar display something while unpacking ? If yes, try to not display anything, because the windows console (conhost) is a big bottleneck too. It could also explain why it's so slow. Could you try ? Thanks

edit: seems like you don't use the "v" option, so tar should not display anything

o-g-o avatar Jun 12 '16 07:06 o-g-o

I've made some tests unpacking linux-4.6.2.tar.xz with "time tar -Jxf linux-4.6.2.tar.xz"

On my surface pro 3 and build 14361, with windows defender exclusion on lxss folder it takes 42 seconds.

With windows defender completely disabled it takes 32 seconds. So windows defender alone (with lxss folder excluded) costs 25% of i/o performance in this case ... I hate antiviruses ...

o-g-o avatar Jun 12 '16 08:06 o-g-o

Yes, all my experiments were with the same command that you used, so no textual output. I have the same build number 14361.

Your numbers are quite good, it probably means there is something wrong with the setup of the machine I used. It's a spare computer I have and that I just took out of the cupboard to try WSL - I didn't want to go to Insider builds on my main computer. However, even the spare shouldn't take that long to untar. But well ...

In other words, given your results, it's likely that it's a problem with my setup and not with WSL, so I suggest we close the issue. I will probably use WSL when it comes out, and if I encounter similar issues again will try to get to the bottom of this.

kanigsson avatar Jun 12 '16 11:06 kanigsson

Closing this out per @kanigsson's comment.

benhillis avatar Apr 10 '17 17:04 benhillis