Profiling DMD's Compilation Time with dmdprof

rikki cattermole rikki at cattermole.co.nz
Thu Nov 8 01:35:29 UTC 2018


On 08/11/2018 4:17 AM, Neia Neutuladh wrote:
> On Thu, 08 Nov 2018 01:49:49 +1300, rikki cattermole wrote:
>> On 08/11/2018 1:46 AM, Patrick Schluter wrote:
>>> Now that the compiler is completely in D, wouldn't it be a good idea to
>>> activate the GC in the compiler. I know that it requires some care for
>>> bootstrapping the compiler when there are dependencies to the D
>>> runtime,
>>> but the compiler would be an excellent example of the advantage of the
>>> GC (i.e. dumb fast allocations as long as there's memory, collection
>>> when no memory left which is miles away better than to get OOM-killed).
>>
>> No, that would be a bad idea currently.
>>
>> https://issues.dlang.org/show_bug.cgi?id=18811
> 
> That issue describes a memory leak. A memory leak of half a megabyte per
> full compiler invocation on a small file should still result in a lot of
> code being compilable on low-end machines that currently isn't.

Its a symptom of a larger set of problems. The frontend is not quite 
ready to have the GC turned on full time.

Based upon my testing, that little memory leak prevents pretty much 
*all* memory allocated by the GC to not be collected. I don't know why, 
but for some reason it pins it. Mind you, my testing could have been 
flawed, and needs more eyes on it *shrug*.


More information about the Digitalmars-d-announce mailing list