5 ms·
I don't understand the big issue with build times: I have always found that they are almost instant for incremental builds (assuming you use lld or mold).
by zamalek 3y ago
I don't understand the big issue with build times: I have always found that they are almost instant for incremental builds (assuming you use lld or mold).
- bluGill 3y agoIn C++ a small change to a header can result in having to rebuild thousands of different files. Even if each file builds fast the total can be long. I have also benchmarked including a specific header (not using it, just including it) costs .5 seconds which adds up quick in those thousand files. Another benchmark found a specific boilerplate code construct added .1 seconds to the time to compile the file each time you added that one line - and it was a line commonly repeating in a header (MOCK_METHOD from gmock - there is a FAQ entry on how to get this time down)
- FpUser 3y agoI do not think it has anything to do with C++. If you are using language that is strongly typed and compiled upfront and have defined some MYTYPE that is used in thousands of files all those need to be recompiled should you change the definition of MYTYPE.
- School-Cotton 3y ago> I have always found that they are almost instant for incremental builds (assuming you use lld or mold) They are not almost instant once your project grows to a certain size, which is still well within the bounds of a realistic single company’s project (I work on Materialize which is all in rust).
- zamalek 3y agoAnd you have it set up with multiple compile units, shared generics, and lld (or mold ideally)?
- School-Cotton 3y ago> multiple compile units Yes > shared generics I don't know what that is. Some googling suggests that it's a nightly-only feature, whereas we use the stable compiler. If it's something that can be done in stable, I'd appreciate a pointer. > lld (or mold ideally) $ echo $RUSTFLAGS -C link-arg=-fuse-ld=lld -C debuginfo=0
- duped 3y agoThen you're not working on big enough projects or in ecosystems where you need to regularly perform clean compiles, because afaik the "incremental" output from cargo/rustc isn't relocatable.