top time wasters in DMD, as reported by gprof

Iain Buclaw ibuclaw at ubuntu.com
Sun Jun 23 23:13:05 PDT 2013


On 24 June 2013 05:53, Timothee Cour <thelastmammoth at gmail.com> wrote:
> On Sun, Jun 23, 2013 at 8:55 PM, Walter Bright <newshound2 at digitalmars.com>
> wrote:
>>
>> On 6/23/2013 8:39 PM, Timothee Cour wrote:
>>>
>>> can you give more context ? what was the command line to get this?
>>
>>
>> Compile on Linux with -pg. Run with:
>>
>>    dmd -main -unittest std/algorithm
>>
>>
>> > I thought lexing was not a bottleneck, yet it seems to be in second
>> > place?
>>
>> The fun with profilers is they tell you things you didn't think were true.
>
>
> more profiliing numbers from Ian Buclaw, for gdc:
> http://forum.dlang.org/post/mailman.1469.1339580395.24740.digitalmars-d@puremagic.com
> http://iainbuclaw.wordpress.com/2010/09/18/implementing-speed-counters-in-gdc/
> http://iainbuclaw.files.wordpress.com/2010/09/d2-time-report2.pdf
> That cam up in an old proposal i made a year ago: "AST files instead of DI
> interface files for faster compilation and easier distribution".
>
>


With that report, all modules are compiled with roughly the equivalent
of dmd's -O -g -release.  So for std.algorithm, it is show to take
0.52 seconds to compile.  However with -unittest turned on, I know it
takes at least a minute for gdc to compile that module (up there with
std.datetime) - and consumes about 2GBs of memory. ;-)


--
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


More information about the Digitalmars-d mailing list