24
submitted 6 days ago* (last edited 5 days ago) by onlinepersona@programming.dev to c/rust@programming.dev

I've got 64 GB of RAM and would like to force cargo to dump build artifacts into it. So basically the target/ directory should end up there.

Unless I'm mistaken RAM is much faster than SSDs and since I do rebuild quite often, it would save some R/W cycles on my SSD and allow faster file access.

I do jot mind doing a full rebuild every morning

Solution:

These 2 comments gave me the best indication how to do it: cargo ramdisk and build.target-dir config options.

Would be great if cargo had a build.target-dir-prefix though. One could set and env var CARGO_TARGET_DIR_PREFIX and point it at /dev/shm or /tmp if it's a tmpfs and every rust project would have its artefacts end up in RAM.

you are viewing a single comment's thread
view the rest of the comments
[-] jenesaisquoi@feddit.org 2 points 5 days ago

Linux uses all free RAM as cache automatically.

this post was submitted on 16 Feb 2025
24 points (100.0% liked)

Rust

6384 readers
202 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 2 years ago
MODERATORS