Skip to content

Conversation

@Firestar99
Copy link
Member

@Firestar99 Firestar99 commented Feb 10, 2026

Maybe it'll speed up our CI?
https://github.com/Swatinem/rust-cache

My investigation log

Adding caching

First run (with no cache present) is looking real bad:

  • windows test +1m 8s
  • windows difftest +6m 24s
    • no idea why the cache would take so long when there's nothing to download and nothing has been compiled???
  • all "install rust toolchain" are now 0s, so we probably have to move them before the cache action

First CI with restore

Comparing latest main to this PR:

  • overall time: 27m 39s -> 16m 8s
  • longest job "windows-difftest": 27m 29s -> 16m 0s
  • cache restore, measured from seconded empty commit in this PR, which may have been removed:
    • windows: 58s to 2m 3s
      • first run of windows difftest has an obscene "restore" of 6m 24s even though there's nothing to restore???
    • linux: ~30s
    • mac: 30s - 40s
  • cache creation, measured from first commit in this PR:
    • windows: 30s - 1m
    • linux: 8s - 15s
    • mac: 30s - 50s

Install toolchain before restore (run attempt #1)

  • rust-cache seems to install the toolchain for you via rustup if you don't do it yourself, toolchain install has 0s execution time
  • Action: move it before cache restore
  • Results: old rust-cache time is now split between rustup install and new rust-cache
  • Could caches contain rustup builds? Try purging caches

purging caches and retrying CI (run attempt #2)

  • as expected, a lot of runtime is moved from "rust-cache" to "install toolchain"
  • rust-cache restore times:
    • windows: 2-3s
    • mac: 1-2s
    • linux: 1-2s
    • => couldn't repo crazy CI times from first attempt, just a fluke?
  • cache creation:
    • windows: 30-50s
    • mac: 30-40s, 60s fluke?
    • linux: ~10s
  • Results: rustup before rust-cache to separate out toolchain install time

Lessen cache usage

job windows mac linux
test 620 MB 590 MB 740 MB
compiletest 310 MB 300 MB 320 MB
difftest 550 MB 550 MB 560 MB
lint 720 MB
android 460 MB
vulkan-sdk 290 MB 500 MB 460 MB

remove rustup env vars

@nazar-pc
Copy link
Contributor

In my projects I usually disable caching on Windows. Their gzip or whatever compression they use is so spectacularly slow that it is faster to download/install things from scratch than decompressing/recompressing cache.

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

Successfully merging this pull request may close these issues.

2 participants