Is the crate dependency becoming a problem?

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

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

    A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...

  • I must admit that I have been noticing this as projects become larger (and hence more complex dependency graphs). The dependencies usually look plentiful, but fortunately, the most popular crates only pull in the bare minimum. In most cases, they depend on "micro-crates" or "sub-crates (of the same workspace)", which is what gives the illusion of "too many crates". A good example of a well-structured project is Tokio, where most dependencies are optional and barred behind additive compilation features.

  • bmrng

    An async MPSC request-response channel for Tokio

  • This was exactly what I did to shave a full minute off CI build times (from 3 minutes to 2 minutes) in one of the projects I depended on. However, rather than just removing default-features, I replaced the futures crate entirely with its significantly lightweight sub-crate futures-core when I realized that the project only ever used futures for the Stream trait.

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

    Mold: A Modern Linker 🦠

  • As for overall compilation performance, try switching to LLD or mold for your linker. (Note that mold is only faster than LLD if you have enough CPU cores. Its advantage is parallelizing better.)

  • cargo-dephell

    Cargo dephell analyzes the third-party dependencies of a Rust workspace

  • Check whackadep and cargo-dephell: https://github.com/mimoo/cargo-dephell and https://github.com/diem/whackadep

  • whackadep

    Managing Rust dependencies via a dashboard

  • Check whackadep and cargo-dephell: https://github.com/mimoo/cargo-dephell and https://github.com/diem/whackadep

  • cargo-udeps

    Find unused dependencies in Cargo.toml

  • Maybe an extension to cargo-udeps?

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