Ben Chuanlong Du's Blog

It is never too late to learn.

Speed Up Rust Build With Cache

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

The article How to alleviate the pain of Rust compile times has a good summary on ways to speed up compilation of Rust projects.

Tips and Traps

  1. The best tool to cache the compiling of a Rust application is to use sccache sccache . cachepot is another such good tool. It is essentially sccache with extra security.

  2. sccache can be used in a Jupyter/Lab notebook with the evcxr kernel as well. Just specify the command :sccache 1 to enable compilation cache using sccache.

  3. The cargo-cache tool is useful for managing compilation cache of Rust applications.

  4. actions/rust-cache is a GitHub Action that implements smart caching for rust/cargo projects with sensible defaults.

References

Comments