RLib โ€” A zero-overhead precompiled crate manager to reduce compile times and disk usage

โš“ Rust    ๐Ÿ“… 2026-05-25    ๐Ÿ‘ค surdeus    ๐Ÿ‘๏ธ 4      

surdeus

Hello, I wanted to share a tool Iโ€™ve been creating on called RLib to gather feedbacks. Itโ€™s a lightweight, zero-overhead development helper designed to precompile crates (like tokio, serde, etc.) and seamlessly share them dynamically across all local workspaces.

Why built this?

We've all been there: every time we spin up a project or run cargo clean, the machine spends minutes re-compiling the exact same dependencies from scratch, bloating SSD storage with duplicate gigabytes in every single target folder.

Unlike caching tools like sccache which rely on compression/decompression algorithms (introducing small time costs when unpacking artifacts), RLib uses a zero-overhead approach. It directly binds and passes the global precompiled binaries into the development workspace via custom path and compiler flag.

Key Features:

  • Universal Reuse: Compile dependency once (~/.rlib), use it everywhere.
  • Save Massive Disk Space: Stops standard dependency duplication across multiple project folders.
  • cargo clean Proof: The cached crates stay safe outside the workspace. Running clean will never wipe the precompiled dependencies unless we explicitly tell RLib to remove them.
  • Under-the-Hood Optimizations: Automatically leverages high-performance linkers (mold, lld) and alternative memory allocators (mimalloc, tcmalloc) seamlessly.

Quick Workflow Example:

  1. Initialize the project config:
rlib init
  1. Precompile crate (e.g., Tokio with full features):

Check if the crate is already on the global list

rlib list

If not there yet, then compile the crate

rlib tokio features=full
  1. Check the global list and copy the unique key:
rlib list
# Output: tokio_1_38_0_full
  1. Link it to the local workspace list:
rlib this add tokio_1_38_0_full
  1. Run the project instantly:
rlib this cargo run
# Or for instant compilation checks:
rlib this cargo check

I'd love to hear your thoughts, feedback, or any edge cases you think I should look out for regarding on anything

Here is the project github : GitHub - fuji-184/RLib ยท GitHub

1 post - 1 participant

Read full topic

๐Ÿท๏ธ Rust_feed