DEV Community

vun
vun

Posted on

Why I built cargo-feat: A 10ms solution to feature lookup friction

The Problem

Every time I add a dependency to Cargo.toml, I need to know what features
it exposes. Current workflow:

  1. Open browser
  2. Search crates.io or docs.rs
  3. Scroll through documentation
  4. Find the feature list
  5. Close browser

Repeat 20 times a day. Annoying.

Existing tools like cargo info exist but are slow (80ms+).

The Solution

Built cargo-feat. Single command. Shows every feature, marks defaults,
lists what each feature pulls in.

$ feat reqwest

— reqwest's features are in the following list —
    ★ default
         default-tls
         charset
         http2
         system-proxy

    — blocking
    — brotli
    — charset          (default)
    ...
Enter fullscreen mode Exit fullscreen mode

Done in 9.9ms.

Why It's Fast

Three optimizations:

  1. Sparse registry index — reads crates.io sparse index directly
    (via Cloudflare CDN). Cargo uses same source. Faster than REST API.

  2. Local cache first — checks ~/.cargo/registry/index/ before network.
    If you've ever built with this crate, result is instant.
    After network fetch, written to cache. Next run: always fast.

  3. Early-stop parsing — scans index from end, stops at first stable
    version. O(1) entries instead of O(n versions).

Also uses MiMalloc + simd-json for JSON parsing.

Benchmarks

(Include table from README or simple comparison)

cargo feat reqwest        9.9 ms
cargo info reqwest       92.7 ms  (9.4x slower)
Enter fullscreen mode Exit fullscreen mode

Works same speed for serde (180+ versions). Lookup time flat
regardless of version count.

Installation

cargo install cargo-feat
Enter fullscreen mode Exit fullscreen mode

Then use it:

feat reqwest              # latest version
feat tokio 1.35.0         # specific version
feat reqwest --deps       # show dependencies
feat reqwest --internals  # show internal features
feat serde --json         # raw JSON output
Enter fullscreen mode Exit fullscreen mode

Try It

GitHub logo vunholy / cargo-feat

Fast CLI tool for Rust that instantly lists a crate’s features from crates.io without opening a browser. Shows default features, dependencies, and metadata with minimal overhead and optimized lookup performance. Built for speed-focused workflows.

cargo-feat

crates.io

A fast command-line tool for Rust developers to instantly look up the available features of any crate on crates.io - directly in your terminal, with no browser required.


Why

When adding a dependency, finding out what features it exposes usually means opening a browser, searching crates.io or docs.rs, and scrolling through documentation. cargo-feat removes that friction: one command gives you a color-coded list of every feature the crate exposes, which ones are enabled by default, and what each feature pulls in.


Demo

$ feat reqwest

— reqwest's features are in the following list —
    ★ default
         default-tls
         charset
         http2
         system-proxy

    — blocking
    — brotli
    — charset          (default)
    — cookies
    — default-tls      (default)
    — deflate
    — gzip
    — http2            (default)
    — ...

Installation

From crates.io

cargo install cargo-feat
Enter fullscreen mode Exit fullscreen mode

From source

Requires a recent stable Rust toolchain.

git clone https://github.com/vunholy/cargo-feat.git
cd cargo-feat
cargo build --release
Enter fullscreen mode Exit fullscreen mode

The compiled binary will be…

Open to feedback. Built this to scratch personal itch,
figured others had same problem.

If you found it interesting, please do star it makes my day :D

Top comments (0)