These are chat archives for rust-lang/rust

Nov 2017
Nov 03 2017 09:50
hi guys, our team is struggling with extremely long build times. Last version of everything, and the new incremental option doesn't help much. Anything we can do?
Aleksey Kladov
Nov 03 2017 09:53
What's the physical architecture of your application? Is it a one crate, or is it a workspace with a large number of small crates?
Jonas Platte
Nov 03 2017 09:54
@scein Update your nightly if you haven't recently, and maybe try ThinLTO
Nov 03 2017 10:12
@matklad 10 crates
a total of 70KLOC
@jplatte isn't thinlto only for release builds? the problem here is waiting 2 minutes in our develop/build/test cycle
Jonas Platte
Nov 03 2017 10:23
@scein Uhh, it might get used in both cases but yeah, probably only beneficial in release builds
Aleksey Kladov
Nov 03 2017 10:32

@scein 10 crates for 70KLOC seems like a pretty reasonable split actually, I was hoping for some low hanging fruit here :(

I think heard that another useful guideline is to try to remove the amount of generic code, using tricks like non-templated base class from C++

Nov 03 2017 10:50
that would be a massive change....
Michal 'vorner' Vaner
Nov 03 2017 11:05
There's a way to side-step this a bit. Tricks that make you use less of the cycles instead of shortening them, like:
  • Using RLS to point out errors early on.
  • cargo check (nightly checks the syntax of tests as well, maybe with some flags)
  • I use cargo watch to let the build/test run „in the background“. I just save, it runs, but I continue coding instead of waiting for it.
The invocation I use for cargo watch:
$ cat bin/cargo-conttest 

export CARGO_TARGET_DIR=`pwd`/target/conttest
exec nice -n5 cargo watch --no-restart -s "cargo test --all --all-features" -s "cargo clippy" -s "cargo doc"