Blog Post: Fast Rust Builds

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • cargo-sweep

    A cargo subcommand for cleaning up unused build files generated by Cargo

  • cargo-sweep can do this kind of garbage collection along a few axes - rustc version, file age, was or wasn't used during recent build. Works great on Linux. I've not gotten it working reliably for -s/-f on MacOS+APFS, but for the CI use case it should be a nice improvement.

  • proc-macro2

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • mold

    Mold: A Modern Linker 🦠

  • Have you tried https://github.com/rui314/mold ? Claims to be significantly faster than lld.

  • rules_rust

    Rust rules for Bazel

  • Other than that, the performance of both for builds should be determined exactly by the organization of code into separate crates and the rustc invocations. Bazel generally encourages smaller crates, but that's very subtle. There is at least 1 case I can think of where rustc is overfit to cargo, in a way that is not easily replicable by bazel, which is the metadata/rlib pipelining https://github.com/bazelbuild/rules_rust/issues/228

  • cargo-chef

    A cargo-subcommand to speed up Rust Docker builds using Docker layer caching.

  • I agree with you that the tutorial is incomplete, but I don't get what you're trying to say. Did you link the wrong thing? That is the CI for cargo-chef (as opposed to a CI setup with cargo-chef), which, unsurprisingly, doesn't use cargo-chef.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts