5 ms·
One thing I wish Rust would improve over time is the builds. Its one of the biggest sources of wasted storage space on all my computers, builds a ton of librari
by giancarlostoro 3mo ago
One thing I wish Rust would improve over time is the builds. Its one of the biggest sources of wasted storage space on all my computers, builds a ton of libraries can take tens of gigs, it adds up very quickly. Not sure what the best solution is, one I found is to set the global build folder so dependencies get reused across projects, but imho it should be an OOTB default behavior whatever the real solution should be.
- c-hendricks 3mo agoI always got a kick out of that, coming from a JavaScript background where people constantly harp on the size of node modules. My Tauri project, where the backend is much smaller code-wise than the frontend, has 9gb of rust artifacts (node_modules is 550mb for comparison)
- tredre3 3mo agoRust isn't great, and it shouldn't be a surprised since it's designed after npm. However one metric where nodes_modules is still worse for me is the sheer number of small files in it. Having nearly one million files in nodes_modules isn't that unusual. The problem is that on most common file systems the minimum allocation is usually at least 4KB. So even if the actual data is less than 500MB, you end up with 4GB disk space used/wasted.
- inigyou 3mo agoI wish ext4 had a feature to mark a file as "atomic" where it would allocate all atomic files in a long run, without room for expansion, and I suppose with very inefficient compaction upon deletion, but without any padding bytes.
- giancarlostoro 3mo agoA file “pointer” for byte exact files, pointer gets ditched for files that get updated or the pointer gets adjusted to another common file.
- epage 3mo agoWe are trading away disk space for faster builds. We could make them faster in some cases by using even more... On the other hand, it would be good to garbage collect those caches. We are wrapping up work on a new layout for intermediate build artifacts that will make it easier to GC them.
- kstrauser 3mo agoCan you talk a little more about that? How would that work, and what would the developer experience be like when using it?
- ameliaquining 3mo agoThe proposal's at https://hackmd.io/@rust-cargo-team/SJT-p_rL2 https://hackmd.io/@rust-cargo-team/SJT-p_rL2; progress is tracked at https://github.com/rust-lang/cargo/issues/12633 https://github.com/rust-lang/cargo/issues/12633.
- giancarlostoro 3mo agoSounds like what I was thinking, that or for third party deps to go into the same temp folder, and anything not accessed in over a week, or so just gets auto wiped by rustc / cargo build process?
- burnt-resistor 3mo agoUse sccache.