Latest compile time profiling / troubleshooting guide?

#1

Build times for a web backend I have are 30 seconds just for the last crate that has one .rs in it with a few hundred LOC. I tried time-passes but it only identified ~10 seconds of the delay.

What’s the recommended guide at this point for getting compile times under control? I’m not sure how to reasonably split this into multiple crates given that the bottleneck is already pretty small - either linking or actix_web + four askama templates.

The 30 seconds is for debug mode, release has lto turned on.

0 Likes

#2

Is your disk fast? I get pretty bad compile times in a Vagrant VM, because ./target ends up on a shared network drive (and it needs fast access to many thousands of files).

0 Likes

#3

If it’s the last crate, and it contains a binary target, are you using LTO? The time might be going into the link phase. You could try disabling it to test.

0 Likes

#4

Yes, it’s an SSD. I didn’t think profile.release should be affecting the debug configuration? But maybe I should try disabling it just in case.

0 Likes