Profiling the D code with gperftools (Google Performance Tools)

Prasun Anand via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Thu Mar 30 10:51:34 PDT 2017


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


More information about the digitalmars-d-ldc mailing list