Does LDC support profiling at all?

David Nadlinger code at klickverbot.at
Sat Dec 23 21:03:46 UTC 2017


On Saturday, 23 December 2017 at 12:23:33 UTC, Johan Engelen 
wrote:
> Fine grained PGO profiling:
> -fprofile-instr-generate
> http://johanengelen.github.io/ldc/2016/07/15/Profile-Guided-Optimization-with-LDC.html
>
> Function entry/exit profiling:
> -finstrument-functions
> https://github.com/ldc-developers/ldc/issues/1839
> https://www.youtube.com/watch?v=LNav5qvyK7I
>
> I suspect it is not too much effort to add DMD's -profile and 
> -profile=gc to LDC, but noone has done it yet.
>
> Another thing that is relatively easy to add to LDC: 
> https://llvm.org/docs/XRay.html

Apart from profiling based on compiler instrumentation, don't 
forget that LDC uses the standard object file formats/runtime 
libraries for the various platforms, so all the usual profiling 
tools like perf, VTune, Valgrind, etc. work just fine.

I would usually start with one of the latter for general-purpose 
optimization work.

  — David


More information about the Digitalmars-d-learn mailing list