<div dir="ltr">Having previous modified the generated projects before I highly advise against it. It's tedious, you have to get all of them, and cmake will blow it away the next time you regenerate. You are much better off using RelWithDebugInfo. Note that the last time I generated VS solutions it generated all 3 and I could switch between them. Check if you can just switch your solution's configuration.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 7, 2017 at 1:55 PM, Reid Kleckner via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">That's surprising, and not expected. Maybe it depends on what's in hello world? stdio.h or boost?<div><br></div><div>I'd profile it and look at it in WPA: <a href="https://randomascii.wordpress.com/2015/04/14/uiforetw-windows-performance-made-easier/" target="_blank">https://randomascii.<wbr>wordpress.com/2015/04/14/<wbr>uiforetw-windows-performance-<wbr>made-easier/</a> This could reveal bottlenecks unique to your system, like AV scanners, network filesystems, or other weird things.</div><div><div><br></div><div>You'll need a PDB, though, to get anything useful out of it. You can either re-configure and re-build with -DCMAKE_BUILD_TYPE=<wbr>RelWithDebInfo, or you can try hacking the VS solution to add "/DEBUG" to the clang.exe linker options. Then it will only be a short re-link.</div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 7, 2017 at 12:57 PM, Nikodemus Siivola via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">One core out of eight sounds plausible indeed! Never thought of that, more used to *nix style usage numbers where 1.0 = one core. :) <div><br></div><div><div>Did a release build:</div><div><br> cmake -G "Visual Studio 14 2015" \</div><div> -DCMAKE_INSTALL_PREFIX=C:\LLVM \</div><div> -DCMAKE_BUILD_TYPE=Release \</div><div> -DLLVM_TARGETS_TO_BUILD=X86 \</div><div> -DLLVM_ENABLE_CXX1Y=On \</div><div> ../<br><br></div><div>That clang still takes >10s to build a hello-world.<br><br>Any suggestions?<br><br>Cheers,</div></div><div><br></div><div> -- nikodemus</div><div><br></div></div><div class="m_-5303579238561054478HOEnZb"><div class="m_-5303579238561054478h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 1, 2017 at 6:11 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><br><div class="gmail_quote"><span><div dir="ltr">On Thu, Jun 1, 2017 at 12:48 AM Hahnfeld, Jonas via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="DE" link="#0563C1" vlink="#954F72"><div class="m_-5303579238561054478m_6730915721708133689m_-6997330470417083920m_1826797291629334283WordSection1"><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">> </span><span lang="EN-US">cmake -G "MinGW Makefiles" \<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"> -DCMAKE_INSTALL_PREFIX=C:\LLVM \<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"> -DCMAKE_BUILD_TYPE=Debug \<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"> -DLLVM_ENABLE_ASSERTIONS=On \<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"> -DLLVM_TARGETS_TO_BUILD=X86 \<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"> </span>-DLLVM_ENABLE_CXX1Y=On \<u></u><u></u></p><p class="MsoNormal"> ../<u></u><u></u></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p></div></div><div lang="DE" link="#0563C1" vlink="#954F72"><div class="m_-5303579238561054478m_6730915721708133689m_-6997330470417083920m_1826797291629334283WordSection1"><p class="MsoNormal"><span lang="EN-US">CMAKE_BUILD_TYPE=Debug will result in a non-optimized compiler. Although I don’t have numbers at hand, you might want to set CMAKE_BUILD_TYPE=Release.</span></p></div></div></blockquote></span><div><br>Also <span style="color:rgb(33,33,33);font-size:13px">-DLLVM_ENABLE_ASSERTIONS=On<br></span><br>The build system at some point had a warning informing users that this might produce an order of magnitude (or more) slower compiler.<br><br>I'd suggest you keep an optimized and unoptimized compiler around. Though even then, Hello World doesn't take me 10 seconds to compile... so maybe there's other things going on. Sounds like you'd want one set of LLVM stuff with all the debugging knobs turned on (exactly as you've built) & use that with your frontend, and another, release build, for running clang, etc for practical porpoises.<br><br><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-5303579238561054478m_6730915721708133689h5"><div lang="DE" link="#0563C1" vlink="#954F72"><div class="m_-5303579238561054478m_6730915721708133689m_-6997330470417083920m_1826797291629334283WordSection1"><p class="MsoNormal"><span lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">Regards,<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">Jonas</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> cfe-dev [mailto:<a href="mailto:cfe-dev-bounces@lists.llvm.org" target="_blank">cfe-dev-bounces@lists.<wbr>llvm.org</a>] <b>On Behalf Of </b>Nikodemus Siivola via cfe-dev<br><b>Sent:</b> Thursday, June 1, 2017 9:43 AM<br><b>To:</b> <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br><b>Subject:</b> [cfe-dev] clang-cl.exe (32bit) dog slow, capping at ~16.5% CPU<u></u><u></u></span></p></div></div><div lang="DE" link="#0563C1" vlink="#954F72"><div class="m_-5303579238561054478m_6730915721708133689m_-6997330470417083920m_1826797291629334283WordSection1"><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">I was wondering why compiles were so slow and noticed that clang-cl.exe is never consuming more than ~16.5% CPU on my laptop. This is an i7-7700HQ, 32GB memory, running Windows 10 Pro.<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Memory and disk use appear trivial as well, and the computer was otherwise mostly idle at the time. <u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Compiling a trivial hello-world takes 11 seconds:<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">$ clang --version</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">clang version 4.0.1</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">Target: i686-pc-windows-msvc</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">Thread model: posix</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">InstalledDir: C:\LLVM\bin</span><u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">$ cat foo.cpp</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">#include <iostream></span><u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">int main()</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">{</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""> std::cout << "Yo" << std::endl;</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New""> return 0;</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">}</span><u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">$ time clang-cl foo.cpp</span><u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">real 0m11.886s</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">user 0m0.015s</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Courier New"">sys 0m0.015s</span><u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Compiling the same program under the Linux subsystem and clang-3.5 takes 0.16seconds. The Visual Studio commandline compiler is likewise almost instant.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">This is release_40 from one of the git mirrors, build built as part of the LLVM tree using Visual Studio 2015 command prompt, with (I think, not 100% sure, don't know cmake well enough to figure out after the fact) the following cmake invovations:<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><div><p class="MsoNormal">cmake -G "MinGW Makefiles" \<u></u><u></u></p></div><div><p class="MsoNormal"> -DCMAKE_INSTALL_PREFIX=C:\LLVM \<u></u><u></u></p></div><div><p class="MsoNormal"> -DCMAKE_BUILD_TYPE=Debug \<u></u><u></u></p></div><div><p class="MsoNormal"> -DLLVM_ENABLE_ASSERTIONS=On \<u></u><u></u></p></div><div><p class="MsoNormal"> -DLLVM_TARGETS_TO_BUILD=X86 \<u></u><u></u></p></div><div><p class="MsoNormal"> -DLLVM_ENABLE_CXX1Y=On \<u></u><u></u></p></div><div><p class="MsoNormal"> ../<u></u><u></u></p></div></div><div><p class="MsoNormal">cmake --build .<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">Did I pick spectacularly stupid build options or something?<u></u><u></u></p></div><p class="MsoNormal" style="margin-bottom:12.0pt"><br>Any suggestions for figuring out what is going on? (Windows is not my regular platform so I'm a bit out of depth here.)<u></u><u></u></p><div><p class="MsoNormal">Cheers,<u></u><u></u></p></div></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"> -- nikodemus<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div></div></div>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
</blockquote></div></div>
</blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>