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.

  • BB_C@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    21 days ago
    • Use zram so swapping doesn’t immediately slow things to a crawl.
    • Use cargo check, often. You don’t need to always compile.
    • Add a release-dev profile that inherits release, use cranelift for codegen in it, and turn off lto.

    Otherwise, it would be useful to know what kind of system you’re running, and how is the system load without any rust dev involvement. It would also be helpful to provide specifics. Your descriptions are very generic and could be entirely constructed from rust memes.