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

drug drug2004 at
Mon Oct 4 06:43:49 UTC 2021

03.10.2021 19:20, max haughton пишет:
> On Sunday, 3 October 2021 at 08:31:14 UTC, Chris Katko wrote:
>> Does it break down on multi-threaded scenarios?
>> I'm running dmd (newest) + Allegro (a C game programming library) with 
>> DAllegro (a nice templated binder). My executable is multi-threaded 
>> (mostly just helper functions / glue logic from libraries/D/etc), and 
>> using OpenGL on 64-bit Linux with a very recent DMD release.
>> [...]
> Unless your profiler does call stack sampling (which I don't think gprof 
> or dmd does), don't use it. They're not reliable unless you are doing 
> very targeted profiling.
> For profiling code, if you're on an Intel, vTune is top dog. Nothing 
> else is as good.

Both sampling and instrumenting profiling can be unreliable. Sampling 
profiler results are subject to sampling rate for example. Instrumenting 
profiler can change timings too much. In fact, sampling and 
instrumentation complement each other.

More information about the Digitalmars-d mailing list