[cfe-dev] Can we make libcxx headers more modular for faster compilation?

Yaron Keren yaron.keren at gmail.com
Wed Oct 2 19:55:12 PDT 2013


Although I just posted how windows.h is not required, in this copy it was
still included.
So I repeated all measurments exactly using the ptime utility to get more
accurate times for all combinations. The compiled code was:

#include <iostream>

int main() {
  std::cout<<"hello cout\n";
  return 0;
}

I repeated every run few times and got consistent results. Here are the
results:

[image: תמונה מוטבעת 1]

* clang is about 50% slower than gcc for all three cases.
* Windows.h doubles compilation time and not required. Remove it out asap!
* Even w/o windows.h, libcxx compilation time is twice the libstdc++
compilation time with either compiler.
* Comparing each compiler with its own library, clang+libcxx compilation is
three times as much slower as gcc+libstdc++.

That's quite a difference not in our favor.

Yaron



2013/10/3 Nico Weber <thakis at chromium.org>

> On Wed, Oct 2, 2013 at 2:36 PM, Jean-Daniel Dupas <devlists at shadowlab.org>wrote:
>
>> support.h includes windows.h on win32 platform.
>> Does libstdc++ also include windows.h. I think this single include may be
>> enough to explain the difference.
>>
>
> It's a problem on Mac (and probably Linux) as well,
> http://llvm.org/PR14587 , so maybe it's not just windows.h.
>
> Looking forward to modules!
>
>
>>
>>
>> Le 2 oct. 2013 à 22:19, Yaron Keren <yaron.keren at gmail.com> a écrit :
>>
>> Thanks, I see that now. It wasn't trivial for me...
>>
>> How can we understand why compiling the trivial program with libcxx is 3x
>> slower vs with libstcd++ ?
>>
>> Yaron
>>
>>
>>
>> 2013/10/2 Joerg Sonnenberger <joerg at britannica.bec.de>
>>
>>> On Wed, Oct 02, 2013 at 06:45:06PM +0300, Yaron Keren wrote:
>>> > Joerg, I am ashmed to admit I have re-read the code and still can not
>>> > understand how basic_string uses tuple. How basic_string uses tuple?
>>>
>>> basic_string -> __compressed_pair -> __libcpp_compressed_pair_imp
>>> -> tuple.
>>>
>>> Joerg
>>> _______________________________________________
>>> 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
>>
>>
>>  -- Jean-Daniel
>>
>>
>>
>>
>>
>> _______________________________________________
>> 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/20131003/a73e8354/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: table.jpg
Type: image/jpeg
Size: 7935 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131003/a73e8354/attachment.jpg>


More information about the cfe-dev mailing list