News for hackers. Stuff that matters.
Re:Comparing C and C++ usage and performance with a real wor... by dozzie on Sunday September 03, 2017 @06:25PM (#15164316)
> What makes C++ compilation slow is reparsing headers again and again and again because the C the preprocessor means that every time they are encountered they may have new semantics.

Really? And I thought that this is why C and C++ headers are typically wrapped in #ifndef-#define-#endif block, so they only produce whitespace after preprocessing on second inclusion.

Re:Comparing C and C++ usage and performance with a real wor... by Matthias247 on Sunday September 03, 2017 @07:21PM (#15164548)
Yes, this happens inside a single translation unit (.cpp file). However if you have multiple .cpp files which include the same header file you have to reparse it each time. This is because before the inclusion of that header different #defines might have been set (e.g. through other headers), and therefore the content of the header file might be different.
Re:Comparing C and C++ usage and performance with a real wor... by astrodust on Sunday September 03, 2017 @07:22PM (#15164552)
It's not the second inclusion that's a problem but the way any given template might behave completely differently depending on what order they're loaded in.

That is, including a, b, c is not necessarily the same as a, c, b or b, a, c. This is not true with proper modules, they're order invariant, and as such you can make a ton of optimiztions.