Speeding up compilation by using jemalloc

weaselcat via Digitalmars-d digitalmars-d at puremagic.com
Fri Jan 23 12:15:51 PST 2015


On Friday, 23 January 2015 at 16:59:41 UTC, Wyatt wrote:
> On Thursday, 22 January 2015 at 19:37:11 UTC, weaselcat wrote:
>> Might be of use to someone, but I was looking for ways to 
>> speed up dmd's albeit already fast compilation times.
>>
>> Just by dropping in jemalloc in place of glibc's malloc via 
>> LD_PRELOAD on my linux machine I saw a 10-15% drop in 
>> compilation times across the board. Not sure if this is common 
>> knowledge or not.
>>
> Might be interesting to try some other implementations, too?  
> TCMalloc[0] and nedmalloc[1] at least have permissive licenses.
>  (Hoard[2] and Lockless[3] also seem interesting, but are GPL 
> or worse.)
>
> -Wyatt
>
> [0] Part of gperf-tools https://code.google.com/p/gperftools/
> [1] 
> http://www.nedprod.com/programs/portable/nedmalloc/index.html
> [2] http://www.hoard.org/
> [3] http://locklessinc.com/downloads/

Hi,
I actually did try tcmalloc and I can't remember if it performed 
better than malloc or not, but it performed overall worse than 
jemalloc. I'm assuming because it's(as the name impllies), 
optimized for heavily threaded scenarios which DMD is not.
I didn't try the others because they're not readily available in 
my package manager.


More information about the Digitalmars-d mailing list