You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For me decompression of a cache on Windows is much slower than on linux. A 360Mb cache takes
only 10sec to download
but 5 minutes to decompress!
The cache consists of many small files (e.g. the boost library) which probably affects performance negatively.
It seems that appveyor switched to 7zip to compress/decompress the cache exactly for performance reasons. Maybe this would also be on option for github actions that run on windows?
Also note that there was already a similar issue (#336) but it was fixed by improving network performance. Here the bottleneck is not the network but the decompression itself...
Reacted by Kline Moralee, Jan Halama (Honsbrok), Max Isom, Florian Richter, Rob Cowsill, Johan Nilsson, Be, Erez Rokah, Harry Chan, Dan Freeman and 6 more
I noticed that issue as well. I thought I could use the cache so I don't have to download the needed compilers and libraries for every run, but loading and extracting them from the cache takes way longer than just redownloading them. That makes the cache pretty useless for my use case.
I also have this problem. I run the same job on Linux, macOS & Windows. And while macOS & Linux take less than 1 minutes, Windows takes almost 4 minutes.
I have experienced the same issue. Setting up a cache with a size of 800 MB takes 20 seconds on Ubuntu while the smaller 600 MB cache takes about 1 min.
They use different commands which can be the reason for the slow decompression. I wonder if actions should use 7z on Windows instead of tar.
Also having a very slow cache restore operation for unzipped gradle-7.0.2-all.zip contents at the path C:\Users\runneradmin\.gradle\wrapper\dists\gradle-7.0.2-all on a Windows runner. Downloading the zip file and decompressing it takes under 2 minutes, whereas using cache restore would take up to 3m43s.
I am seeing the same thing, it's just too slow!
Can the team not do something about this? Just pinging some recently active devs @vsvipul, maybe you can help?
Just as an update: I just switched to runs-on: windows-2022 and suddenly the decompression times are 4x faster. Still slower than Linux/macOS, but much improved. Maybe other see the same?
But: still too slow!
Hi @shichen85@coreysharris@Safihre . As @aminya observed, zstd is disabled on Windows due issues with bsd tar. We are working on a longer term solution. You could meanwhile use the workaround suggested here to improve performance. This would enable zstd while using GNU tar.
TLDR; Add the following step to your workflow before the cache step. That's it.
- if: ${{ runner.os == 'Windows' }}
name: Use GNU tar
shell: cmd
run: |
echo "Adding GNU tar to PATH"
echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"
Activity
Leseratte10 commentedon Nov 10, 2020
I noticed that issue as well. I thought I could use the cache so I don't have to download the needed compilers and libraries for every run, but loading and extracting them from the cache takes way longer than just redownloading them. That makes the cache pretty useless for my use case.
quanglam2807 commentedon Dec 26, 2020
I also have this problem. I run the same job on Linux, macOS & Windows. And while macOS & Linux take less than 1 minutes, Windows takes almost 4 minutes.
arvinxx commentedon Feb 6, 2021
Yes, I meet this problem too, the Windows cost almost 5mins every cache. It really a time waste !!!
airglow923 commentedon Feb 10, 2021
Experienced the same issue on Windows. Here's the config I used:
On
ubuntu-lastest:On
windows-latest:As you can see, that margin is extreme.
aminya commentedon Jun 1, 2021
I have experienced the same issue. Setting up a cache with a size of 800 MB takes 20 seconds on Ubuntu while the smaller 600 MB cache takes about 1 min.
They use different commands which can be the reason for the slow decompression. I wonder if actions should use 7z on Windows instead of tar.
aminya commentedon Jun 2, 2021
They have disabled zstd compression on Windows, and that is why Windows caching is so slow. Related to #301
https://github.com/actions/toolkit/blob/439eaced077b820cbf01183f71a220813514a95b/packages/cache/src/internal/cacheUtils.ts#L88-L91
coreysharris commentedon Jun 14, 2021
Seeing the same thing. Here using
actions/cache@v2onwindows-latest(911 MB in 232 secs):And here on
ubuntu-18.04(934 MB in 19 secs):Caching doesn't seem worthwhile on windows
shichen85 commentedon Jan 17, 2022
Also having a very slow cache restore operation for unzipped gradle-7.0.2-all.zip contents at the path
C:\Users\runneradmin\.gradle\wrapper\dists\gradle-7.0.2-allon a Windows runner. Downloading the zip file and decompressing it takes under 2 minutes, whereas using cache restore would take up to 3m43s.Safihre commentedon Feb 8, 2022
I am seeing the same thing, it's just too slow!
Can the team not do something about this? Just pinging some recently active devs @vsvipul, maybe you can help?
Safihre commentedon Feb 9, 2022
Just as an update: I just switched to
runs-on: windows-2022and suddenly the decompression times are 4x faster. Still slower than Linux/macOS, but much improved. Maybe other see the same?But: still too slow!
mattjohnsonpint commentedon May 9, 2022
@Safihre - Still to slow for me, even on windows-2022. See #752 (comment)
Safihre commentedon May 9, 2022
Yeah, I also saw it in my runs.
But based on the lack of any responses here, they (Github) don't seem to care at all.
3 remaining items
lvpx commentedon Aug 22, 2022
Hi @shichen85 @coreysharris @Safihre . As @aminya observed,
zstdis disabled on Windows due issues with bsd tar. We are working on a longer term solution. You could meanwhile use the workaround suggested here to improve performance. This would enable zstd while using GNU tar.TLDR; Add the following step to your workflow before the cache step. That's it.
Hope this helps.
Safihre commentedon Aug 22, 2022
For my project this makes it even slower.. Taking 1:20 min to unpack 35MB 😑
Anyone else having better results?
lvpx commentedon Aug 22, 2022
@Safihre could you share your workflow file or the sample run or logs if possible?
Safihre commentedon Aug 22, 2022
@pdotl we use an action that caches a Python virtual environment, but under the hood that uses the actions/cache
I repeated the workflow run 3 times, so 2 times it had a cache hit. The correct tar seems to be used:
https://github.com/sabnzbd/sabnzbd/runs/7958313964?check_suite_focus=true#step:6:23
lvpx commentedon Aug 22, 2022
@Safihre I'm not sure what the issue is. I tried running a similar albeit simpler workflow to yours using the
syphar/[email protected]action but still found windows to be reasonably fast for ~24 mb cache. https://github.com/pdotl/sample-cache-demo/actions/runs/2906664955. Deeper look is needed.lvpx commentedon Nov 16, 2022
We are tracking this issue in #984. Please check the current proposal there and provide comments/feedback if any. Closing this as duplicate.