C/C++ 分析工具库 Prof

码农软件 · 软件分类 · 性能测试和优化 · 2019-11-27 08:59:51

软件介绍

Prof 是 Linux 的自容器 C/C++ 分析工具库。

Prof 提供一个快速的方法来度量 C/C++ 代码片段的性能事件 (CPU 时钟周期等等) 。

小示例:

#include "prof.h"int main()
{    PROF_START();    // slow code goes here...
   PROF_STDOUT();
}

自定义选项

#include <stdio.h>
#define PROF_USER_EVENTS_ONLY
#define PROF_EVENT_LIST \
    PROF_EVENT_CACHE(L1D, READ, MISS) \
    PROF_EVENT_CACHE(L1D, WRITE, MISS)
#include "prof.h"
int main()
{
    uint64_t faults[2] = { 0 };
    PROF_START();
    // slow code goes here...
    PROF_DO(faults[index] += counter);
    // fast or uninteresting code goes here...
    PROF_START();
    // slow code goes here...
    PROF_DO(faults[index] += counter);
    printf("Total L1 faults: R = %lu; W = %lu\n", faults[0], faults[1]);
}

安装

wget -q https://raw.githubusercontent.com/cyrus-and/prof/master/prof.h

本文地址:https://codercto.com/soft/d/19888.html

Ruby元编程(第2版)

Ruby元编程(第2版)

[意] Paolo Perrotta / 廖志刚 / 华中科技大学出版社 / 2015-8-1 / 68.80

《Ruby元编程(第2版)》在大量剖析实例代码的基础上循序渐进地介绍Ruby特有的实用编程技巧。通过分析案例、讲解例题、回顾Ruby类库的实现细节,作者不仅向读者展示了元编程的优势及其解决问题的方式,更详细列出33种发挥其优势的编程技巧。本书堪称动态语言设计模式。Ruby之父松本行弘作序推荐。一起来看看 《Ruby元编程(第2版)》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

在线进制转换器
在线进制转换器

各进制数互转换器