Rust
Rust and RunsOn is a match made in heaven:
Rust | RunsOn |
---|---|
Has slow compilation times | Provides runners with at least 30% better CPU performance than GitHub |
Builds and tests benefit heavily from multiple CPUs | Provides a ton of different runners with various CPU/memory configs to optimize build speed |
Caches are often gigantic and get invalidated quickly due to GitHub’s 10GB cache limit | Has Magic Cache with unlimited size and faster restore/save via S3 |
Can be expensive to run on powerful machines | Uses spot capacity for ~90% cost savings |
Benchmarks
Lychee
Lychee ↗ is a fast, async, stream-based link checker written in Rust. It finds broken URLs and mail addresses inside Markdown, HTML, reStructuredText, websites and more.
It already has an optimized CI workflow, but due to the low speed of GitHub runners, switching to RunsOn still managed to provide at least 30% faster builds, while being ~90% cheaper.
Benchmarks show that even when switching to a much larger runner size (16 CPUs instead of 4), it is still ~80% cheaper than GitHub, while being more than 2x faster.
How to speed up your Rust builds
Once you have installed RunsOn in your AWS account, you can get all the speedups by adding two lines:
- Switch
runs-on:
definition to your runner specification (here: a 4 CPUs x64 Linux runner) - Enable the Magic Cache by adding the label
extras=s3-cache
, and theruns-on/action@v1
action.
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml jobs: test: runs-on: ubuntu-latest runs-on: "runs-on=${{ github.run_id }}/runner=4cpu-linux-x64/extras=s3-cache" steps: - uses: runs-on/action@v1 - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - uses: taiki-e/install-action@nextest - uses: Swatinem/rust-cache@v2 - name: Compile run: cargo check --locked - name: Test run: make test
Conclusion
Anyone still using the official GitHub Actions runners for their Rust builds is missing out, both in performance and cost.
RunsOn is the only all-in-one solution that can be full self-hosted in your own AWS account, and comes with up-to-date compatible runner images, transparent S3-based caching for unlimited size and very fast transfers, spot instances for 90% cost savings, and a ton of other features.
Get started now and get your Rust builds in GitHub Actions 10x cheaper and much faster with RunsOn.