需要分析帮助 [英] Profiling help required
问题描述
我有一个分析问题 - 想象我有以下代码...
void main()
pre>
{
well_written_function();
badly_written_function();
}
void well_written_function()
{
for(一个小数字)
{
highly_optimised_subroutine
}
}
void badly_written_function()
{
for(一个浪费和不必要的大数字)
{
highly_optimised_subroutine
}
}
void highly_optimised_subroutine()
{
//很多代码
}
如果我在vtune(或其他分析器)下运行这是很难发现任何错误。所有热点将出现在已经优化的标记为// lot of code的部分中。 badly_written_function()不会以任何方式突出显示,即使它是所有麻烦的原因。
有一些vtune的功能,将帮助我找到问题?
是否有某种模式,我可以找到badly_written_function()及其所有子功能所用的时间? p>
解决方案这通常被称为callgraph profile,我相当肯定Visual Studio会这样做。
I have a profiling issue - imagine I have the following code...
void main() { well_written_function(); badly_written_function(); } void well_written_function() { for (a small number) { highly_optimised_subroutine(); } } void badly_written_function() { for (a wastefully and unnecessarily large number) { highly_optimised_subroutine(); } } void highly_optimised_subroutine() { // lots of code }
If I run this under vtune (or other profilers) it is very hard to spot that anything is wrong. All the hotspots will appear in the section marked "// lots of code" which is already optimised. The badly_written_function() will not be highlighted in any way even though it is the cause of all the trouble.
Is there some feature of vtune that will help me find the problem?
Is there some sort of mode whereby I can find the time taken by badly_written_function() and all of its sub-functions?
解决方案That's usually known as a "callgraph profile", and I'm fairly sure Visual Studio will do that.
这篇关于需要分析帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!