How to speed up the Rust compiler in July 2022

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
  • rust

    Empowering everyone to build reliable and efficient software.

  • There are efforts to switch to LLD by default on Linux (tracking issue) and Windows (tracking issue). For recent developments, there is an open PR for adding a few flags to simplify this.

  • rules_apple_linker

    Bazel rules for overriding ld64 with lld or zld

  • For folks using macOS looking for other potential linker improvements, it's worth trying out ld64.lld. Facebook and google have been heavily investing in it and it's quite a bit faster than ld64. I have a small rust benchmark linking alacritty here but if there are significantly larger open source rust projects I could test with I would love to hear about them.

  • 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
  • cargo-chef

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

  • If you're deploying Rust with Docker I can tell you that cargo-chef is invaluable. With zero work it caches the dependency fetch and compilation steps. Most of the time the ens Docker deploy is closer to an incremental compile than full.

  • rust-analyzer

    A Rust compiler front-end for IDEs

  • rustc_codegen_cranelift

    Cranelift based backend for rustc

  • compiler-team

    A home for compiler team planning documents, meeting minutes, and other such things.

  • Something I saw mention it recently was an accepted proposal for build-time execution sandboxing, where the intended implementation is a WebAssembly-based runtime. It mentions that it hopes it could also set the foundations in the compiler for optimizations like watt with reusable build artifacts.

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