gperftools

本文介绍了Google Performance Tools,包括高性能多线程内存分配器TCMalloc及性能分析工具如堆检查器、堆剖析器和CPU剖析器等。这些工具适用于C/C++程序,能够帮助开发者找出性能瓶颈。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

以下是摘自google-code的介绍

Google Performance Tools

The fastest malloc we've seen; works particularly well with threads and STL. Also: thread-friendly heap-checker, heap-profiler, and cpu-profiler.

Overview

Perftools is a collection of a high-performance multi-threaded malloc() implementation, plus some pretty nifty performance analysis tools.

Perftools is distributed under the terms of the BSD License.

For downloads, news, and other information, visit our Project Page.

Example

Note: this is by no means complete documentation, but simply gives you an idea of what the API is like.

No recompilation is necessary to use these tools.

TC Malloc:

gcc [...] -ltcmalloc

Heap Checker:

gcc [...] -o myprogram -ltcmalloc
HEAPCHECK=normal ./myprogram

Heap Profiler:

gcc [...] -o myprogram -ltcmalloc
HEAPPROFILE=/tmp/netheap ./myprogram

Cpu Profiler:

gcc [...] -o myprogram -lprofiler
CPUPROFILE=/tmp/profile ./myprogram

Sample Output

The heap profiler can pop up a window that displays information as a directed graph:

12191451_0HFU.png

The cpu profiler can produce a weighted call graph:

12191451_cANT.gif

Documentation

Downloads

For downloads, please visit our Downloads Page.

Links to Other Sites

Russ Cox's gperftools-httpd, a simple http server based on thttpd that enables remote profiling via google-perftool's pprof.

Brett Viren's Perftools project at the Brookhaven National Laboratory -- a similar project with the same name as Google's. [docs], [download]

Questions and Feedback

While this wiki page allows comments, I don't check it very often. If you have questions, comments, or feedback, please direct them to google-perftools@googlegroups.com.

转载于:https://my.oschina.net/liangzi1210/blog/113288

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值