[cfe-dev] Clang on Windows targteing gcc compiles very slowly

Yaron Keren yaron.keren at gmail.com
Sun May 31 21:24:38 PDT 2015


Edward, could you time the snapshot binaries from http://llvm.org/builds/ ?


2015-06-01 0:10 GMT+03:00 Reid Kleckner <rnk at google.com>:

> Another thing to consider is that clang-cl doesn't implement /MP, the cl
> flag for multiprocessing. If you are comparing cl with MSBuild to clang-cl
> MSBuild, clang will go slower because it doesn't run multiple compiles in
> parallel.
>
> This, however, doesn't explain the 2x slowdown vs gcc from Edward's
> experimentation. So far all we have are theories on that.
>
> On Sun, May 31, 2015 at 12:34 AM, Dennis Luehring <dl.soluz at gmx.net>
> wrote:
>
>> another example:
>> https://github.com/RuntimeCompiledCPlusPlus/RuntimeCompiledCPlusPlus
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_RuntimeCompiledCPlusPlus_RuntimeCompiledCPlusPlus&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=hpC7ORUVDxV3DqdNE1rZh4bacUTo6WBN_6dS1Mfbc7w&s=Ayk3MRBdMUQBGcUkzqLI__oMrbF3ygfnsqNArf4AW_g&e=>
>>
>> compiles in a minute in VS2010 - take years with cl-clang, with
>> compile-bug reports in cl-clang
>>
>> so my "dirty" testbase for finding speed difference and bugs in cl-clang
>> would be
>>
>> -Xerces C++ 3.1.2 (SVN Tag)
>> -DosBox (latest SVN)
>> -RuntimeCompiledCPlusPlus (lastest Git)
>> -ScummVM (SVN)
>>
>>
>>
>> Am 31.05.2015 um 09:06 schrieb Dennis Luehring:
>>
>>> >Huh, that's surprising. Do you happen to
>>> >have VS2013 too? What are you
>>> >compiling? Anything open-source?
>>>
>>> just VS2010 - and a very closed source project, 5 libs, ~50-100kLOC,
>>> around 1200 Warnings (legacy code)
>>>
>>> latest Xerces C++ is another example (does not fully link under
>>> cl-clang) - some warnings
>>> svn co https://svn.apache.org/repos/asf/xerces/c/tags/Xerces-C_3_1_2
>>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__svn.apache.org_repos_asf_xerces_c_tags_Xerces-2DC-5F3-5F1-5F2&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=hpC7ORUVDxV3DqdNE1rZh4bacUTo6WBN_6dS1Mfbc7w&s=uDCJVQRwnx8UQrzjD8ex6aW0dwPlUcrvB3Prj0pv134&e=>
>>> VC2010: ~1:59min
>>> cl-clang: stopped at ~6:15 with link error
>>>
>>> or latests DosBox (gives compiler bug report) - many warnings
>>> VC2010: ~1:25
>>> cl-clang: stopped at ~3:19 with compiler-bug report
>>>
>>> it seems that the cl-clang guys should do compiletests against more
>>> dirty projects - not against
>>> the super-clean chrome sources :)
>>>
>>>
>>> Am 31.05.2015 um 08:21 schrieb Nico Weber:
>>> > Huh, that's surprising. Do you happen to have VS2013 too? What are you
>>> > compiling? Anything open-source?
>>> >
>>> > That build is release but with asserts enabled. Disabling asserts saves
>>> > ~30% of runtime, but that would still be 1:30min which is still slower
>>> than
>>> > VS. We only compared to 2013 though, maybe 2010 is faster than 2013?
>>> >
>>> > On Sat, May 30, 2015 at 11:14 PM, Dennis Luehring <dl.soluz at gmx.net>
>>> wrote:
>>> >
>>> > > VS2010 ~1:12min
>>> > > cl-clang (plugin download from 5.5.2015) ~2:15min
>>> > > clang-238562 ~2:11min
>>> > >
>>> > >
>>> > > Am 31.05.2015 um 07:48 schrieb Nico Weber:
>>> > >
>>> > >> Can you try the clang-cl.exe in
>>> > >>
>>> > >>
>>> http://commondatastorage.googleapis.com/chromium-browser-clang/index.html?path=Win/
>>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__commondatastorage.googleapis.com_chromium-2Dbrowser-2Dclang_index.html-3Fpath-3DWin_&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=hpC7ORUVDxV3DqdNE1rZh4bacUTo6WBN_6dS1Mfbc7w&s=0Z7dhEHRXNw2FRaTdSNkgEqbJbpyzUFjX-QpxLo64os&e=>
>>> > >> ?
>>> > >>
>>> > >> On Sat, May 30, 2015 at 10:46 PM, Dennis Luehring <dl.soluz at gmx.net
>>> >
>>> > >> wrote:
>>> > >>
>>> > >> > im using the cl-clang vstudio plugin binary from the homepage and
>>> it
>>> > >> > compiles slower (nearly 2 times i think) then cl
>>> > >> >
>>> > >> >
>>> > >> > Am 31.05.2015 um 07:40 schrieb Nico Weber:
>>> > >> >
>>> > >> >> Can you post the cmake invocation you use?
>>> > >> >>
>>> > >> >> In general, we see clang being faster than gcc on linux/mac, and
>>> about
>>> > >> as
>>> > >> >> fast as cl.exe on windows on our bots. It sounds like you don't
>>> > >> configure
>>> > >> >> your build correctly. (clang-built-by-clang is a bit faster than
>>> > >> >> clang-built-by-cl on windows; I don't know how
>>> clang-built-by-clang and
>>> > >> >> clang-built-by-gcc on windows compare. But if you're seeing a
>>> 2-3x
>>> > >> >> slowdown, you're probably accidentally doing a debug build of
>>> clang
>>> > >> >> somehow.)
>>> > >> >>
>>> > >> >> On Sat, May 30, 2015 at 9:57 PM, Francois Pichet <
>>> pichet2000 at gmail.com
>>> > >> >
>>> > >> >> wrote:
>>> > >> >>
>>> > >> >> > I just noticed that assert is turned on even in Release on
>>> Windows
>>> > >> >> > Is that on purpose? (seems like a bug to me)
>>> > >> >> >
>>> > >> >> > Anyway if I build clang with "LLVM_ENABLE_ASSERTIONS:BOOL=OFF"
>>> the
>>> > >> build
>>> > >> >> > get stuck at verifier.cpp from LLVMCore. CL.exe is stuck in an
>>> > >> infinite
>>> > >> >> > loop.
>>> > >> >> >
>>> > >> >> > I am using MSVC 2013 Update 5.
>>> > >> >> >
>>> > >> >> > On Sat, May 30, 2015 at 10:30 AM, Reid Kleckner <
>>> rnk at google.com>
>>> > >> wrote:
>>> > >> >> >
>>> > >> >> >> You said you configured in release mode, but assertions might
>>> still
>>> > >> be
>>> > >> >> >> on. That accounts for a 2x slowdown. Otherwise I'd say that we
>>> > >> haven't
>>> > >> >> >> profiled and optimized clang on windows very much.
>>> > >> >> >>
>>> > >> >> >> Sent from phone
>>> > >> >> >> On May 29, 2015 4:51 PM, "Edward Diener" <
>>> > >> >> eldlistmailingz at tropicsoft.com>
>>> > >> >> >> wrote:
>>> > >> >> >>
>>> > >> >> >>> I test Boost libraries mostly on Windows using various
>>> version of
>>> > >> gcc
>>> > >> >> >>> 4.3 and up, VC++ 8.0 and up, and the latest version of clang
>>> which
>>> > >> I
>>> > >> >> build
>>> > >> >> >>> from source using mingw/gcc-4.8.1 in release mode.
>>> > >> >> >>>
>>> > >> >> >>> While clang is a great compiler when it comes to testing
>>> code,
>>> > >> getting
>>> > >> >> >>> intelligent error message, and implementing the latest C++
>>> > >> standard,
>>> > >> >> it is
>>> > >> >> >>> noticably slower ( 2x or 3x at minimum ) than the other
>>> compilers I
>>> > >> >> use.
>>> > >> >> >>>
>>> > >> >> >>> The clang command line parameters usually being used are
>>> usually
>>> > >> along
>>> > >> >> >>> the lines of:
>>> > >> >> >>>
>>> > >> >> >>> -c -x c++ -O0 -g -fno-inline -Wall -g -march=i686 -m32
>>> > >> >> >>>
>>> > >> >> >>> with the addition of 'std=c++11' occasionally depending on
>>> the
>>> > >> test.
>>> > >> >> >>>
>>> > >> >> >>> Does anybody have any idea why clang is so much slower than
>>> any of
>>> > >> the
>>> > >> >> >>> other compilers I use ? It does not seem to matter whether
>>> it is in
>>> > >> >> C++03
>>> > >> >> >>> mode or C++11 mode, it is noticeably slower than the other
>>> > >> compilers.
>>> > >> >> >>>
>>> > >> >> >>> _______________________________________________
>>> > >> >> >>> cfe-dev mailing list
>>> > >> >> >>> cfe-dev at cs.uiuc.edu
>>> > >> >> >>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>> > >> >> >>>
>>> > >> >> >>
>>> > >> >> >> _______________________________________________
>>> > >> >> >> cfe-dev mailing list
>>> > >> >> >> cfe-dev at cs.uiuc.edu
>>> > >> >> >> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>> > >> >> >>
>>> > >> >> >>
>>> > >> >> >
>>> > >> >> > _______________________________________________
>>> > >> >> > cfe-dev mailing list
>>> > >> >> > cfe-dev at cs.uiuc.edu
>>> > >> >> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>> > >> >> >
>>> > >> >> >
>>> > >> >>
>>> > >> >>
>>> > >> >>
>>> > >> >> _______________________________________________
>>> > >> >> cfe-dev mailing list
>>> > >> >> cfe-dev at cs.uiuc.edu
>>> > >> >> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>> > >> >>
>>> > >> >
>>> > >> > _______________________________________________
>>> > >> > cfe-dev mailing list
>>> > >> > cfe-dev at cs.uiuc.edu
>>> > >> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>> > >> >
>>> > >>
>>> > >>
>>> > >
>>> >
>>>
>>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150601/35d66c99/attachment.html>


More information about the cfe-dev mailing list