164
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
this post was submitted on 17 Jul 2026
164 points (96.6% liked)
Linux
66500 readers
685 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 7 years ago
MODERATORS
Five minutes with build cache? Or from cold build?
With cache, then there's almost certainly something wrong with your computer or project.
Also... you aren't building with --release every time are you?
No, I'm not using --release every time of course. And sometimes it's minutes even with the cache.
That's highly abnormal to have minute long debug build times.
for 100k loc?
100k loc without a reasonable architecture is... problematic.
I have run into problems with C++ linker/optimizers which will choke on big (50k loc) .cpp files which are auto-generated from definitions, they get slow like that, build times around 20 minutes for the worst of them. Keep the files more like 10k loc and down if you don't want this kind of issue.
Nowhere did I say there's no reasonable architecture. Please don't put words in my mouth. What I said, is that I haven't found a good way to get quick compiles end to end. And already I don't have any files more than 3-4k loc, most are under 1k.
Yeah I doubt it. I've worked in large Rust codebases too. I'd do some benchmarking. Cargo has some nice flags that let you see exactly what it's doing. You can open the compilation report up in a browser and zoom in on different steps of the process and see everything.
I've tried looking before and couldn't get a significant improvement. I'll have to investigate it again I guess.
Make sure you're using a fast linker. Although I think
lldis the default now, so that should be less of a concern these days. But see ifmoldorwildwould help.More relevantly, you should be using cranelift for codegen in dev builds.
If you have
codegen-units = 1in yourreleaseprofile, make sure you have a separate dev profile that doesn't.If you still experience decapitating slowness (doubtful), and it's actually the rust compiler being slow (super doubtful), you can try the parallel frontend. Apparently there are almost™ no bugs left in its implementation (It's one of the project priorities now).
Needless to say, but you should be checking your
--timingsto really know what's going on.thanks will see what happens
It would be a cool if you report back in a separate post if you discovered anything interesting. It's not like we're overwhelmed by too much activity here.
Also, while I think it should be obvious, but I forgot to clarify that if you're inheriting from a profile with
codegen-units = 1, then you need to set that explicitly to a higher value in the inheriting profile.yeah, if I find any dramatic improvement I'll follow up
The various linkers do make a difference, but all of them choke, eventually, when individual files get too massive.