Re:Speeding up C++ build times
by josephg on Tuesday April 30, 2024 @12:59AM
(#40207395)
Yep. Worst case, every header is included in every translation unit. Assuming you have a similar proportion of code in your headers and source files, compilation time will land somewhere between O(n) and O(n^2) where n = the number of files. IME in large projects its usually closer to n^2 than n.
(Technically big-O notation specifically refers to worst case performance - but thats not how most people use the notation.)
(Technically big-O notation specifically refers to worst case performance - but thats not how most people use the notation.)