Why C++ compiles slowly

Steven Schveighoffer schveiguy at yahoo.com
Mon Aug 23 10:20:24 PDT 2010


On Mon, 23 Aug 2010 12:44:50 -0400, Walter Bright  
<newshound2 at digitalmars.com> wrote:

> Steven Schveighoffer wrote:
>> On Wed, 18 Aug 2010 21:05:34 -0400, Walter Bright  
>> <newshound2 at digitalmars.com> wrote:
>>
>>> http://www.drdobbs.com/blog/archives/2010/08/c_compilation_s.html
>>>
>>> I'll be doing a followup on why D compiles fast.
>>  Very interesting stuff.
>>  I'd like to have an article describing how to diagnose slow D  
>> compilation :P
>>  Dcollections with unit tests compiles in over a minute, with I think  
>> about 12 files that contain implementation.  I estimate probably 5000  
>> loc.
>
> You can start with -v.

I get a long list of functions proceeding at a reasonable rate.  I've done  
that in the past, I feel it's some sort of inner loop problem.   
Essentially, something takes way longer to compile than it should, but way  
longer on the order of .05 seconds instead of .005 seconds, so you don't  
notice it normally.  But somehow my library is able to harness that  
deficiency and multiply by 1000.

I don't know, it doesn't seem like dcollections should evoke such a long  
compile time.

-Steve


More information about the Digitalmars-d mailing list