3 ms·
In 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 al
by bluGill 3y ago
In 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.