<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Feb 9, 2019 at 11:26 AM Jon Chesterfield &lt;<a href="mailto:jonathanchesterfield@gmail.com">jonathanchesterfield@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><br><div dir="auto">I have a suspicion that my codebase is sufficiently coupled that modules will bring the maximum build concurrency down to within the core count of a single server, at which point icecc won&#39;t be necessary.</div></div></blockquote><div><br></div><div>This is what I had originally thought. However, last week I wrote a miniscript[1] to analyze how much of an issue this would be, and I was surprised to see that it basically won&#39;t be a problem. A few people in the SG15 slack channel posted results for their codebases, and they all seemed fairly similar. I aggregated them here: <a href="https://gist.github.com/RedBeard0531/23330df6cf9e320e5ff80febae2b522f">https://gist.github.com/RedBeard0531/23330df6cf9e320e5ff80febae2b522f</a> (if anyone else wants to add theirs, send me an email). Single file results count each header once, the first time it is encountered. Multi-file results aggregate them, so each header is counted once per cpp that transitively includes them. These indicate to me that the BMI generation DAG won&#39;t be the bottleneck that limits parallelism because at all times, except perhaps the first second or two of a clean build there should be more than enough parallelism to hit another bottleneck (either local CPU or network) that limits us to 200-400 parallel jobs today with headers.</div><div><br></div><div>My concern with distributed builds is that we haven&#39;t figured out the mechanics of how they will efficiently work yet, or proven that they can. With headers it is (almost) trivial to just ship the result of compiling with -E and either -frwrite-includes or -fdirectives-only to a remote host and get back a .o.  It is unclear what the equivalent for modules will be.<br></div><br><div>[1] There are probably some linuxisms and zshisms here, but it should be easy to remove them:  for file in path/to/source/**/*.{cpp,cc,cxx}; do echo $file &gt; /proc/$$/fd/1; g++  -all-your-flags -especially -Ipaths -DMACROS -and -std=c++VERSION &quot;$file&quot; -fdirectives-only -o /dev/null -H -E; done |&amp; \grep -E &#39;^\.+ &#39;  | sed -e &#39;s/ .*//&#39; | sort -S 1G | uniq -c | awk &#39;{print $1, &quot;headers at depth&quot;, length($2)}&#39;<br></div></div></div></div></div></div>