4 ms·
Does compile time really matter that much? I mean, unless you are building a huge project which is expected to take hours to compile, I don't see much benefit i
by Aldo_MX 12y ago
Does compile time really matter that much? I mean, unless you are building a huge project which is expected to take hours to compile, I don't see much benefit in optimizing compile times.
- throwawayaway 12y agoi worked out the number of compilations i did for a year and the cost of c++ vs. c for a 15000 line project and i think it came to ten minutes total. which i found shocking, but there it was. my perception was different from the reality.
- Scea91 12y agoI am working on a project where full rebuild takes about an hour. Fortunately, we do not need to perform full rebuild often on our development machines so most of the time I can build with the changes I've made in between 10 secs to 5 minutes. I would expect this to be similar for other projects. Surely we care about build speed, but there is no need to care about such micro optimizations as qsort vs std::sort. Most of the speedup is in correctly separating translation units and not including unnecessary header files (sometimes forward declaration is enough for example...). With that said, when there are some tradeoffs then optimizing build speed is among one of the last things we care about.
- kbart 12y agoTo fully rebuild the whole project (U-Boot, Kernel, fs) I'm currently working takes 6 to 8 hours on 8 core i7 and believe me, I've done it may times.. So yes, compile time does matter sometimes.
- humanrebar 12y ago> Does compile time really matter that much? Yes. Which is why C++ needs modules. It's a big problem when people have to alter their designs to work around their tools (compilers, in this case).
- Aldo_MX 12y agoOf course compile time matters when features like modules provide a significant improvement. My question was more focused in having to work around the compiler by doing micro-optimizations, or avoiding some features that "may be heavy", just because one project will take 65535ms instead of 65000ms to do a minimal rebuild. But at the end of the day, it really depends on the dimensions of the project. In a huge project an improvement from 8 hours to 7.5 hours is greatly appreciated.
- comex 12y agoIt matters to me because when I'm "in the zone", every second spent waiting for a compiler to do its thing is a small loss of focus; ideally I'd like incremental compilation time to be below a second. Your brain may be less sensitive to this latency, but I think loss of focus happens to everyone to some extent. The cost of template instantiations by itself is not too significant, and they ought to be cacheable in the future C++ module system, along with the header file parsing that's the biggest factor making C++ take longer to compile than, say, C. But with today's compilers, it all adds up.