> caching the cargo home can help. It wasn’t a massive gain relative to sccache, though. Similar story with caching the target directory
Can you please clarify this point? Caching how?
Re:Why is my Rust build so slow?
by mplanchard on Friday December 31, 2021 @02:24PM
(#29751537)
Persisting it across jobs, using whatever your CI framework lets you do. We cache this stuff using the workspace cargo.lock checksum as the primary cache key
- sccache is pretty much essential
- beefiness: GitLab’s default runners for example are way too underpowered and made our builds take like 30 minutes (as opposed to 5 on a beefy machine in CircleCI). We’re working on switching to self-hosted runners for GL
- replacing diesel with sqlx saved us a fair bit of time
- caching the cargo home can help. It wasn’t a massive gain relative to sccache, though. Similar story with caching the target directory
- lld linking was another relatively small win, but a win nonetheless
- splitting things up into smaller libraries and binaries (all in one workspace) helped us a fair bit, since building/testing some targets can now totally skip some libraries, but I imagine YMMV