最近在公司做优化程序,主要使用工具是gperftools。
每个分析阶段都是可以使用这个工具分析一把然后再进行优化的分析。
1.gperftools
下载源码包:https://github.com/gperftools/gperftools
配置:./configure –prefix=/usr/local/gperftools –enable-frame-pointers
然后make && make install
使用:将bin里面的pprof放在 /usr/bin下面
在 /etc/ld.so.conf 文件中添加lib路径,然后ldconfig一下。
程序分析使用方法:
*gperftools使用步骤:(多线程的情况下)
1.首先安装gperftools,使用源码安装的方式。
2.加入头文件
2.graphviz
下载源码包: http://www.graphviz.org
配置:./configure
然后make && make install
使用:
bin路径添加到PATH环境变量中
lib 在/etc/ld.so.conf 文件中添加lib路径
3.ghostscript
下载源码包:http://www.ghostscript.com/
配置:./configure
然后make && make install
使用:把bin下面的程序软连接或者是声明PATH来使系统能找到程序。
lib需要也是可以添加lib路径的。