RLib โ A zero-overhead precompiled crate manager to reduce compile times and disk usage
โ Rust ๐ 2026-05-25 ๐ค surdeus ๐๏ธ 4Hello, 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 cleanProof: 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:
- Initialize the project config:
rlib init
- 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
- Check the global list and copy the unique key:
rlib list
# Output: tokio_1_38_0_full
- Link it to the local workspace list:
rlib this add tokio_1_38_0_full
- 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
๐ท๏ธ Rust_feed