template statistics

FeepingCreature feepingcreature at gmail.com
Wed Jun 3 08:40:18 UTC 2020


On Tuesday, 2 June 2020 at 08:37:35 UTC, FeepingCreature wrote:
> On Tuesday, 2 June 2020 at 06:47:54 UTC, Walter Bright wrote:
>> Many people are trying to figure out what templates are 
>> blowing up their compile. This should help:
>>
>> https://github.com/dlang/dmd/pull/11208
>
> Nice!
>
> Wishlist: if you could dump out a template instantiation 
> backtrace combined with system time for every template 
> declaration start and end, it should be easy to convert this 
> into callgrind format ( 
> https://valgrind.org/docs/manual/cl-format.html ), which would 
> let us use graphical profilers with it.

Update: I've hacked up an extremely basic callgrind dump, just to 
test the format. It's based on line numbers, not functions, which 
callgrind doesn't like: "functions" are 
"file_filename_line_linenr". 
https://github.com/FeepingCreature/dmd/commit/aa379ba7750b8d32f35906dc93d3c381cfa90e45 Note I'm *really* not sure if I'm doing the inclusive/exclusive accounting correctly.

Did some internal testing. format!() seems to eat up a lot 
(40%?), not sure if I'm reading this right, but it wouldn't 
surprise me.


More information about the Digitalmars-d mailing list