Go vs. D [was Re: Rust vs Dlang]

Dmitry Olshansky dmitry.olsh at gmail.com
Tue Mar 26 02:49:07 PDT 2013


26-Mar-2013 13:38, Rory McGuire пишет:
>
> On Tue, Mar 26, 2013 at 4:43 AM, Walter Bright
> <newshound2 at digitalmars.com <mailto:newshound2 at digitalmars.com>> wrote:
>
>     How to do profiling with the dmd D compiler:
>
>     1. Add the -profile switch to the command line.
>
>     2. Read the report generated.
>
>     To do coverage analysis:
>
>     1. Add the -cov switch to the command line.
>
>     2. Read the report generated.
>
>     That's it.
>
>
> Hi Walter,
>
> Thanks I remember about the -profile switch but I don't see memory usage
> there. If you see your program using more and more memory even though it
> should not be
> how do you check where the problem is?
> In Go you generate a graph that shows the relationship between the
> various function calls their memory use and cpu time. Its not a flashy
> graph I think they use graphviz or something.
>
> What would I use in D to profile heap usage? Would I be able to find the
> problem area as quickly?
>

What everybody in all other native languages use, for instance:
valgrind --tool=massif, valgrind --tool=callgrind

Any general purpose profiler works.  I can confirm that e.g. AMD 
CodeAnalyst works just fine if application is compiled with symbols. 
Intel's Vtune also should work as well as many opensource tools.

-- 
Dmitry Olshansky


More information about the Digitalmars-d-announce mailing list