How accurate is dmd profile? (and do I need GMD/LDC to use gprof?)

Imperatorn johan_forsberg_86 at hotmail.com
Wed Oct 6 05:34:54 UTC 2021


On Monday, 4 October 2021 at 06:10:00 UTC, bauss wrote:
> On Sunday, 3 October 2021 at 21:55:29 UTC, H. S. Teoh wrote:
>> On Sun, Oct 03, 2021 at 08:31:14AM +0000, Chris Katko via 
>> Digitalmars-d wrote: [...]
>>> [...]
>> [...]
>>
>> Be aware that dmd -profile uses *16-bit counters* for tracking 
>> function call counts; if your program is CPU-intensive and 
>> calls the same function(s) in inner loops more than 65535 
>> times, the counters will wrap around and cause the profile 
>> output to be garbled.
>>
>> I ran into this a couple of years ago when trying to profile 
>> some CPU-intensive code with some non-trivial testcases, and 
>> found dmd -profile output completely unusable because of this 
>> limitation.
>>
>>
>> T
>
> What the... I had no idea but that alone deems it useless to me.

Maybe we can change it


More information about the Digitalmars-d mailing list