LCA: Lessons from 30 years of Sendmail
LCA: Lessons from 30 years of Sendmail
Posted Feb 8, 2011 0:37 UTC (Tue) by cmccabe (guest, #60281)In reply to: LCA: Lessons from 30 years of Sendmail by mpr22
Parent article: LCA: Lessons from 30 years of Sendmail
> O(m * n), where m = number of source files and n = number of ubiquitously
> included header files, is rather closer to the mark.
Header files tend to include other header files. This is a consequence of one of the other design features of C++, the fact that the definition of a class cannot be spread across multiple files.
So you often see stuff like this:
> #include "private_helper.h"
>
> class MyClass {
> ...
> private:
> PrivateHelper myPrivateHelper;
> };
PrivateHelper is not be part of the public API of the class (hopefully), but even so, it will require you to include private_helper.h. That class itself might have its own private helpers... and so it goes, on and on.
What's that, you say? I can use the pImpl idiom? Sure, if I can live with reduced performance and more boilerplate code to initialize and destroy the pImpl. Sigh.
It would be interesting to graph, say, WebKit compilation times as a function of the number of files. I really doubt it's anywhere close to linear.