Profilers 检测与采样 [英] Profilers Instrumenting Vs Sampling

查看:48
本文介绍了Profilers 检测与采样的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究分析器之间主要是检测和采样.我想出了以下信息:

I am doing a study to between profilers mainly instrumenting and sampling. I have came up with the following info:

  • 采样:停止程序的执行,取PC从而推断程序是
  • 检测:添加一些开销代码到程序,所以它会增加一些了解程序的指针

如果以上信息有误,请指正.

If the above info is wrong correct me.

此后,我查看了执行时间,有人说检测比采样花费的时间更多!这是正确的吗?

After this I was looking at the time of execution and some said that instrumenting takes more time than sampling! is this correct?

如果是,那是为什么?在抽样中你必须付出进程之间上下文切换的代价,而在后者中你在同一个程序中没有成本

if yes why is that? in sampling you have to pay the price of context switching between processes while in the latter your in the same program no cost

我错过了什么吗?

干杯!=)

推荐答案

采样分析器生成的中断通常会在总执行时间中增加微不足道的时间,除非您的采样间隔非常短(例如 <1毫秒).

The interrupts generated by a sampling profiler generally add an insignficant amount of time to the total execution time, unless you have a very short sampling interval (e.g. < 1 ms).

使用检测分析可能会有很大的开销,例如在被多次调用的小叶函数上,因为与函数的执行时间相比,对检测库的调用可能很重要.

With instrumented profiling there can be a large overhead, e.g. on small leaf functions that get called many times, as the calls to the instrumentation library can be significant compared to the execution time of the function.

这篇关于Profilers 检测与采样的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆