DMD producing huge binaries

Johan Engelen via Digitalmars-d digitalmars-d at puremagic.com
Fri May 20 06:07:56 PDT 2016


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 (!!!).

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.



More information about the Digitalmars-d mailing list