DMD producing huge binaries

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Fri May 20 06:24:42 PDT 2016


On 05/20/2016 09:07 AM, Johan Engelen wrote:
> On Friday, 20 May 2016 at 12:30:10 UTC, Andrei Alexandrescu wrote:
>> On 05/20/2016 08:21 AM, Johan Engelen wrote:
>>>
>>> https://github.com/ldc-developers/ldc/pull/1445:
>>> "Hashed symbols look like this:
>>> _D3one3two5three3L3433_46a82aac733d8a4b3588d7fa8937aad66Result3fooZ
>>> ddemangle gives:
>>> one.two.three.L34._46a82aac733d8a4b3588d7fa8937aad6.Result.foo
>>> Meaning: this symbol is defined in module one.two.three on line 34. The
>>> identifier is foo and is contained in the struct or class Result."
>>
>> This is nice. How difficult would it be to rework it into a PR for
>> dmd? -- Andrei
>
> I can work on it, but only if it will not result in a long debate
> afterwards (!!!).

Thanks. I'll get back to you on that.

> One obstacle is the hasher itself: I am not going to implement one
> myself! In the LDC PR, I used LLVM's MD5 hasher and Phobos's MD5 hasher.
> Perhaps it is better to use a faster hasher (I have no expertise on
> that; Murmur?), so we will have to carry our own copy of a good hasher
> implementation. Or perhaps the speedlimit is memory access and hash
> algorithm speed doesn't matter.
>
> I made the hashing optional, with a symbol length threshold. Getting rid
> of the variable threshold would be good, such that the (few) large
> symbols in Phobos are hashed too and all will work fine. Perhaps 1k is a
> good threshold.

I don't see a need for hashing something. Would a randomly-generated 
string suffice?


Andrei



More information about the Digitalmars-d mailing list