Why doesn't DMD create any redundant symbols?

Christopher Wright dhasenan at gmail.com
Thu Feb 14 18:02:19 PST 2008


Frank Benoit wrote:
> Walter Bright schrieb:
>> Gregor Richards wrote:
>>> Walter Bright wrote:
>>>> Gregor Richards wrote:
>>>>> I have to assume there's a reason for this, so, to summarize: Why 
>>>>> doesn't DMD create any redundant symbols in .o files?
>>>>
>>>> It can improve build speed a lot. With C++, which doesn't do this, 
>>>> huge .obj files can be generated.
>>>>
>>>> The compiler assumes that if there are multiple modules on the 
>>>> command line, they'll all be linked together, so why generate 
>>>> redundant output?
>>>
>>> OK, so how about for those willing to (or required to) take the 
>>> performance penalty, adding an option to create redundant data? I 
>>> imagine the speed difference between compiling one file at a time and 
>>> compiling all at once but with redundant data is greater than the 
>>> speed difference between compiling all at once with and without 
>>> redundant data, so your improvement to build speed significantly 
>>> hinders my build speed.
>>
>> It's a good idea, but it would be a fair bit of work the way dmd is 
>> designed.
> 
> DSSS has the option oneatatime=on as the default now, to avoid problems. 
> But the compile time is no more acceptable.
> 
> Several ppl complained that after 15 min they canceled compilation of 
> DWT. With doing it with oneatatime=off the same took <15 sec.
> 
> See also http://d.puremagic.com/issues/show_bug.cgi?id=1838
> 

The problem being that, without those possibly redundant symbols, you 
get stuff dying at link time because DMD never bothered to include the 
symbol anywhere?

Performance is secondary to correctness.



More information about the Digitalmars-d mailing list