www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - Profiling the D code with gperftools (Google Performance Tools)

reply Prasun Anand <prasunanand.bitsp gmail.com> writes:
Hi,

I have been working on a Bioinformatics tool that handles large 
matrices, say 8000 rows * 8000 columns.

I was interested in profiling my D code and find out which 
function executes for what duration(clock ticks). I used 
gperftools(Google Performance Tools) and hence,
created the D bindings for it and released it as a dub package 
"gperftools_d"

Links:
1. https://github.com/prasunanand/gperftools_d
2. https://code.dlang.org/packages/gperftools_d

It shows really cool output as graph visualizations and which are 
the critical nodes (functions that take maximum time).

A very simple example of visualization can be found 
[here](https://github.com/prasunanand/gperftools_d/blob/master/examples/profile.pdf).
Here I am calculating Fibonacci series.

It has other cool features too like heap_profiling, stacktrace, 
etc.

I hope this tool would be helpful to D community and would love 
to hear your feedback.

Regards,
Prasun
Mar 30
parent reply Johan Engelen <j j.nl> writes:
On Thursday, 30 March 2017 at 17:51:34 UTC, Prasun Anand wrote:
 Hi,

 I have been working on a Bioinformatics tool that handles large 
 matrices, say 8000 rows * 8000 columns.

 I was interested in profiling my D code and find out which 
 function executes for what duration(clock ticks). I used 
 gperftools(Google Performance Tools) and hence,
 created the D bindings for it and released it as a dub package 
 "gperftools_d"
Nice. Perhaps you could try and get D functionname demangling in gperftools? ;-) cheers, Johan
Mar 30
parent Prasun Anand <prasunanand.bitsp gmail.com> writes:
On Thursday, 30 March 2017 at 20:56:18 UTC, Johan Engelen wrote:
 On Thursday, 30 March 2017 at 17:51:34 UTC, Prasun Anand wrote:
 Hi,

 I have been working on a Bioinformatics tool that handles 
 large matrices, say 8000 rows * 8000 columns.

 I was interested in profiling my D code and find out which 
 function executes for what duration(clock ticks). I used 
 gperftools(Google Performance Tools) and hence,
 created the D bindings for it and released it as a dub package 
 "gperftools_d"
Nice. Perhaps you could try and get D functionname demangling in gperftools? ;-) cheers, Johan
Thanks :) Function-name demangling might be there in the next release :). Regards, Prasun
Mar 31