- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我编写了一个简单的 C++ 程序,使用 for 循环打印从 1 到 100 的数字。我想找出特定程序在运行时发生的 TLB 命中数和未命中数。有没有可能得到这些数据?
我正在使用 Ubuntu。我用过 perf 工具。但它在不同的时间产生不同的结果。我很困惑我的代码的哪一部分导致了如此大量的 TLB 命中、TLB 未命中和缓存未命中。
当然可能还有其他进程同时运行,比如 Ubuntu GUI。但是,这个结果是否也包括那些过程?我使用的命令:perf stat -e dTLB-loads -e dTPerformance counter stats for './hellocc':
结果:第一次——
909,822 dTLB-loads
2,023 dTLB-misses # 0.22% of all dTLB cache hits
4,512 cache-misses
0.006821182 seconds time elapsed
LB-未命中 ./hellocc
结果:第二次——'./hellocc' 的性能计数器统计:
907,810 dTLB-loads
2,045 dTLB-misses # 0.23% of all dTLB cache hits
4,533 cache-misses
0.006780635 seconds time elapsed
我的简单代码:
#include <iostream>
using namespace std;
int main
{
cout << "hello" << "\n";
for(int i=1; i <= 100; i = i + 1)
cout<< i << "\t" ;
return 0;
}
最佳答案
您可以模拟的一种方法是使用 cachegrind , valgrind 的一部分。
Cachegrind simulates how your program interacts with a machine's cache hierarchy and (optionally) branch predictor. It simulates a machine with independent first-level instruction and data caches (I1 and D1), backed by a unified second-level cache (L2). This exactly matches the configuration of many modern machines.
虽然这不是您的硬件,我认为您无法获得,但它是一个很好的替代品。
关于c++ - 我如何在 ubuntu 中分析 TLB 命中和 TLB 未命中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9298910/
关于 APC 操作码缓存,什么是“命中与未命中”?我已经安装了 APC 并且它运行良好,但我有“一些”失误,我想知道这是否“不好”。此外,我正在运行 Openx,因此,我很快就会填满“缓存完整计数”。
我试过这个: def test_send_confirm_hit(monkeypatch): hit = False def called(): global hit
是否可以将找到的单词插入到替换中? $(function() { content = 'hallo mein name ist peter und ich komme aus berlin.
我有一个允许用户将文件上传到文件夹的网站。首先,我检查文件是否存在,如果存在,然后检查复选框的值以确定用户是否要覆盖现有文件。如果点击上传并且未选中该框,我会执行一个带有消息和后退按钮的 die()
我有多个不同的进程通过 IPC 进行通信,当使用 gdb 调试单个进程时,每当遇到断点时,我都会尝试向其他进程发送消息。有没有一种方法可以自动在遇到断点时自动调用一个函数/一段代码(NotifyAll
目前,通过管道传输到 jq 的 cat 命令帮助我解析工作目录中的多个 JSON 文件,并根据正则表达式模式匹配文件中所有可用的电子邮件 ID。但是,我很想识别正则表达式模式被命中/匹配的文件名 ca
我们希望将 podname 解析为 IP,以在 akka 集群中配置种子节点。这是通过在 Kubernetes 中使用 headless (headless)服务和有状态集的概念来实现的。但是,如何在
Maven 项目具有以下文件夹结构: src/main/java src/main/resources src/test/java src/test/resources 如果我们导航到 Maven 项
我只使用 c 几个星期,所以很可能会出现我忽略的明显错误。我看过其他线程,但我不明白我正在读的很多内容。该程序假设有一个无限大的牌组。 已知问题: clearBuffer 当前未使用,我正在尝试不同的
我已将我的 AdMob 代码实现到我的 XML 文件中,如下所示: 在我的 Activity 的 onCreate 方法中: // load ads
我的作业是通过示例程序确定给定跟踪文件的缓存读/写/未命中/命中次数。 举例来说,这是示例跟踪输出的前 10 行。 0x37c852: W 0xbfd4b18c 0x37cfe0: W 0xbfd
https://plnkr.co/edit/2h6fV5yTjeUqLP3SvbvO?p=preview 预期 登录后应用程序重定向到 $state container,其中包含 dashboard
ElasticSearch 独立于 from 和 size 参数,基于查询的所有命中构建聚合结果。在大多数情况下,这是我们想要的,但我有一个特殊情况,我需要将聚合限制为前 N 个命中。 limits
我使用 Intel PCM 进行细粒度的 CPU 测量。在我的代码中,我试图测量缓存效率。 基本上,我首先将一个小数组放入 L1 缓存(通过多次遍历),然后启动计时器,再遍历数组一次(希望使用缓存),
我在为 javascript 滑动元素定义点击区域时遇到问题。 参见示例: http://www.warface.co.uk/clients/warface.co.uk/ 请滑过右侧的灰色框以显示按钮
我正在尝试在 foldersystem 中使用 os.walk() 找到几个 'my_file.bat',如果文件名匹配它应该用 subprocess.call() 或 .run() 调用。问题是 o
我有一个端点,我可以在其中请求我使用 Siesta 查询的多条数据(例如 https://example.com/things?ids=1,2,3) .如果我只缓存了一些 things ,我试图弄清楚
这是我的代码: public static function test(){ try{ $apiContext = ApiContext::create(
我使用 PHP 在需要时传递登录表单,代码如下: $htmlForm = ''.''; switch(LOGIN_METHOD) { case 'both': $htmlFor
我正在使用 nginx-lua带有 redis 的模块提供 ember-app 的静态文件. index文件内容存储在redis作为 value由 nginx 正确提供服务当(根)domain/IP被
我是一名优秀的程序员,十分优秀!