DMD producing huge binaries
ZombineDev via Digitalmars-d
digitalmars-d at puremagic.com
Fri May 20 04:32:16 PDT 2016
On Friday, 20 May 2016 at 09:48:15 UTC, ZombineDev wrote:
> On Thursday, 19 May 2016 at 22:16:03 UTC, Walter Bright wrote:
>> On 5/19/2016 6:45 AM, Andrei Alexandrescu wrote:
>>> I very much advocate slapping a 64-long random string for all
>>> Voldermort returns
>>> and calling it a day. I bet Liran's code will get a lot
>>> quicker to build and
>>> smaller to boot.
>>
>> Let's see how far we get with compression first.
>>
>> https://github.com/dlang/dmd/pull/5793
>>
>> Using 64 character random strings will make symbolic debugging
>> unpleasant.
>
> Unfortunately, the PR doesn't cure the root cause, but only
> provides linear 45-55% improvement, which doesn't scale with
> the exponential growth of the symbol size:
>
>
> case time to compile du -h strings file | wc -c
> NG-case before 0m19.708s 339M 338.23M
> NG-case after 0m27.006s 218M 209.35M
> OK-case before 0m1.466s 16M 15.33M
> OK-case after 0m1.856s 11M 9.28M
>
> For more info on the measurements:
> https://github.com/dlang/dmd/pull/5793#issuecomment-220550682
IMO, the best way forward is:
+ The compiler should lower voldemort types, according to the
scheme that Steve suggested
(http://forum.dlang.org/post/nhkmo7$ob5$1@digitalmars.com)
+ After that, during symbol generation (mangling) if a symbol
starts getting larger than some threshold (e.g. 800 characters),
the mangling algorithm should detect that and bail out by
generating some unique id instead. The only valuable information
that the symbol must include is the module name and location
(line and column number) of the template instantiation.
More information about the Digitalmars-d
mailing list