this post was submitted on 06 Mar 2026
27 points (100.0% liked)

Rust

7906 readers
7 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
 

Rust analyzer and compilation are very slow. My system is heating up, running out of ram and disk space. I have 8 GB ram.

I use helix editor.

edit: thank you for all your suggestions. I am breaking up the project into smaller crates to see if that makes a difference.

I got the biggest improvements from zram and sccache. With zram my memory usage stays at 90% instead of fully running out when rust-analyzer starts.

you are viewing a single comment's thread
view the rest of the comments
[โ€“] vas@lemmy.ml 2 points 2 weeks ago

My system is heating up

A small note on that. If you could live with the compilation speed but it's annoying to have the CPU fans working all the time, you could address it by moving the CPU to a more power-efficient mode. Though that will only slow things down for you, and you're saying it's already slow and you're running out of RAM, so maybe heat/fans are not your biggest concern.

Personally, I currently use intel CPUs. Old ones I could undervolt AND limit in watts, making them silent and reducing power usage by a third at the cost of ~5% performance. My current one doesn't support undervolting sadly, and the options for wattage limits are also almost fully gone. What I use now is:

/etc/tmpfiles.d/cpu-prefer-powersafe.conf

# Possible values: default performance balance_performance balance_power power
w /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor - - - - powersave

Replacing "powersave" with "power" cuts the energy usage by half and makes the CPU fully silent at ~50 degrees... at the cost of 30% performance on this new CPU :(( Or keeping it as above, energy usage goes down somewhat (haven't measured precisely), CPU mostly silent at 50-60 degrees, performance down by 15%.

OK probably I wrote waay too much ๐Ÿ˜