How can I understand what is causing extremely long build times?

I have multiple workspaces in my project on of which is the api. While everything else builds in reasonable time everytime when I try to build the api (which has 13 dependencies and 11 of those are common with other workspaces) it takes around 10 minutes to build with optimizations disabled.
Then only different thing in there is actix-web and actix-rt. Any suggestions what I can do to reduce compile times or is this common for actix projects ?

Yes, you can get timings of the entire build:

3 Likes

Is that available on stable or nightly is still needed?

Nightly is needed. For future reference, any time you see a flag that has -Z, that indicates nightly.

1 Like


well apparently that doesnt tell me much of anything. I cant understand what is taking soooo long.
this is basically me changing a single letter or something and recompiling

Cargo -Ztimings only gives crate-level overview. To get detailed information for a crate, you need to use the profiler built into rustc. You can learn more about that here: https://blog.rust-lang.org/inside-rust/2020/02/25/intro-rustc-self-profile.html

1 Like