Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing the cache takes a very long time on Windows #169

Open
Shnatsel opened this issue Aug 28, 2023 · 7 comments
Open

Writing the cache takes a very long time on Windows #169

Shnatsel opened this issue Aug 28, 2023 · 7 comments

Comments

@Shnatsel
Copy link

The post-run phase of rust-cache takes a long time on our CI in https://github.com/rustsec/rustsec, but only on Windows.

Here's a sample log that shows MacOS cache completing in 38 seconds: https://github.com/rustsec/rustsec/actions/runs/6002426049/job/16278755180?pr=969

And here's the same job on Windows-MSVC, with the post-run phase taking over 5 minutes: https://github.com/rustsec/rustsec/actions/runs/6002426049/job/16278755358?pr=969

This is something that we have consistently observed, not a one-off.

The job definition can be found here: https://github.com/rustsec/rustsec/blob/b6def7c9fa30d7da2b2f569a9cded0f041d68068/.github/workflows/cargo-audit.yml#L36-L54

@Shnatsel
Copy link
Author

After talking to a few people about it, it seems that Github Actions Windows runners simply have very slow networking, so this is not something that can be easily fixed in this action.

It might be possible to improve slightly by increasing the compression ratio on Windows, for example.

@jqnatividad
Copy link

jqnatividad commented Apr 3, 2024

Writing the cache on Windows is just painfully slow compared to macOS and Linux action runners.
You would think that since GH is owned by Microsoft that they'd optimize the Windows runners a bit more.
Just wanted to add that any improvement on its performance would be much appreciated!

In my workflows though, it takes a very long time to compress the cache with a Zstd compression level of 10, and the network copy time is negligible by comparison.

https://github.com/jqnatividad/qsv/actions/runs/8535984799/job/23383567613

Maybe the compression level is too high?

@bukowa
Copy link

bukowa commented Jun 29, 2024

It's not about network, but this command:

"C:\Program Files\Git\usr\bin\tar.exe" -xf D:/a/_temp/e75808bb-fd10-4be7-8c4e-562c289751df/cache.tzst -P -C D:/a/tauri-e2e/tauri-e2e --force-local --use-compress-program "zstd -d"

I remember reading about this tar from git being just slow.
Should probably try with other software to unpack archive - and then if its faster make a PR detecting windows and using that.

@bukowa
Copy link

bukowa commented Jun 29, 2024

@Shnatsel
Copy link
Author

That seems to be a different issue. That one is about extraction, but the step that seems to take a long time is compression at the end.

@bukowa
Copy link

bukowa commented Jun 30, 2024

I migrated to https://github.com/actions/cache/blob/main/examples.md#rust---cargo

And even there Windows is slower both on extraction and compression *(but much better than rust-cache)

@Enduriel
Copy link

Enduriel commented Jul 8, 2024

This is also an issue for me on windows, I can't view the original workflow files posted with this issue but for me the workflow takes almost 3 minutes to restore the cache (see here). It seems to be the extraction step that is taking forever for me, not compression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants