cosmic-applets icon indicating copy to clipboard operation
cosmic-applets copied to clipboard

reduce memory consumption on compile

Open soloturn opened this issue 1 year ago • 3 comments

feeling a little embarrarssed by asking the question - but would it be possible to reduce the memory consumption of cosmic-applets on compile? a couple of weeks or motnths ago cosmic-applets could be compiled on a 8gb machine, nowadays 16gb are necessary. am doing the following when building for everything in cosmic-epoch:

MOLD_JOBS=1 CARGO_TARGET_DIR=/tmp/mytarget cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
MOLD_JOBS=1 CARGO_TARGET_DIR=/tmp/mytarget cargo build --release --frozen

soloturn avatar Aug 02 '24 02:08 soloturn

You can either change lto from fat to thin in the Cargo.toml, reduce the number of threads that you use, or configure zram with zstd compression.

mmstick avatar Aug 02 '24 05:08 mmstick

Don't know that my opinion is worth much but I wanted to try cosmic out ahead of any binary releases and wanted to do it on a machine I don't really care about and compiling cosmic-applets has been an absolute nightmare. I probably could have done what OP did rather than just giving myself a whack ton of swap space but I have been compiling for about 11 hours. Worst part is I have no idea how much longer this is going to take.

I doubt there is much you can do but long term I'd love to see this not be so difficult to compile or at the very least get a progress bar on this sub module. Chances are if I have to compile cosmic-applets again as it is right now and can't bypass this step I'm just not going compile cosmic from source.

Hopefully this finishes sometime soon cause I'm excited to try cosmic. Also thank you all for the amazing work. I can't imagine it's easy to build a DE from the ground up.

drazil100 avatar Aug 05 '24 13:08 drazil100

I wanted to try cosmic out ahead of any binary releases

@drazil100 If all you want is to try the latest stuff they build it several times a day, so if you're on Pop!_OS 24.04 with popdev:master enabled a standard update with COSMIC-store will pull binaries only a few hours old. I think the Fedora COSMIC copr is also built frequently.

Hyperchaotic avatar May 22 '25 00:05 Hyperchaotic