untar is very slow
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
Is that something others experience as well?
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 ?
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.
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
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 ...
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.
Closing this out per @kanigsson's comment.