<div dir="ltr">Hi<br><br>I hope it's OK that I post here even though I'm not a developer on the clang compiler itself. Googling turns up a bunch of answers that appear to be pure speculation (even on StackOverflow), so I thought maybe the clang developers had more informed opinions about it.<br><br>Common wisdom says that one should keep c++ implementations in separate files (not in header files), to reduce recompilation times. However, that brings out the fear that it might hurt runtime performance, as the compiler might have less information available for inlining. But then again, clang does whole module optimization, so maybe there would be no difference performance-wise? On the other hand, there's the concept of precompiled headers, so maybe it wouldn't make any difference for compile times either.<br><br>So the questions are:<br>1) With link-time optimization set to monolithic, will a project split into separate compilation units be equally well optimized as with the header-only approach?<br>2) Will it make a difference to compilation times, compared to the header-only approach, using precompiled headers?<br><br>The longer link times with lto does not matter, because most of the time you'll be doing debug builds, without lto.<br><br>Per<br></div>