gperftools_d ~master
D bindings for gperftools
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
gperftools_d
D bindings for gperftools(Google Performance Tools)
<a href="https://code.dlang.org/packages/gperftoolsd" title="Go to gperftoolsd"><img src="https://img.shields.io/dub/v/gperftoolsd.svg" alt="Dub version">
Install google-perftools and graphviz
Install go and then install google-pprof.
Add Place the code you want to profile within Example: In the To profile:
This software is distributed under the BSD 3-Clause License.
Copyright © 2017, Prasun Anand
Installation
sudo apt-get install google-perftools libgoogle-perftools-dev graphviz
go get github.com/google/pprof
Performance Profiling
gperftools_d
in dub.json
as a dependency.
"dependencies": {
"gperftools_d": "~>0.1.0"
}
ProfilerStart()
and ProfilerStop()
.
examples/source/app.d
file:
import std.stdio;
import gperftools_d.profiler;
int fib(int x) {
if(x == 0){
return 0;
}
else if(x == 1){
return 1;
}
else{
return (fib(x-1) + fib(x-2));
}
}
void main() {
ProfilerStart(); // Profiling Starts
foreach (i; 0 .. 30) {
writeln(fib(i));
}
ProfilerStop(); // Profiling Stops
}
dub --compiler=ldc2
CPUPROFILE=/tmp/prof.out <path/to/binary> [binary args]
pprof <path/to/binary> /tmp/prof.out # -pg-like text output
pprof --gv <path/to/binary> /tmp/prof.out # really cool graphical output
pprof --pdf <path/to/binary> /tmp/prof.out > profile.pdf # dump graphical output in profile.pdf
Example output:
LICENSE
- Registered by Prasun Anand
- ~master released 7 years ago
- prasunanand/gperftools_d
- www.prasunanand.com
- BSD 3-Clause License
- Copyright © 2017, Prasun Anand
- Authors:
- Dependencies:
- none
- Versions:
-
0.1.0 2017-Mar-29 ~master 2017-Apr-01 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
1 downloads this month
-
221 downloads total
-
- Score:
- 0.9
- Short URL:
- gperftools_d.dub.pm