如何在“调用树"中跟踪.net框架方法在 Visual Studio 中进行分析时 [英] How to track the .net framework methods in "Call Tree" when profiling in Visual Studio

查看:53
本文介绍了如何在“调用树"中跟踪.net框架方法在 Visual Studio 中进行分析时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Visual Studio 2008 中使用探查器 像这样,但是当我分析这些代码时,我只能在调用树"视图中找到自己编写的方法.如何跟踪 .NET Framework 中定义的内部/私有方法?

I'm using profiler in Visual Studio 2008 like this, but when I profiling these codes I can only find the methods written by myself in "Call Tree" view. How can I track the inner/private methods defined in .NET Framework?

推荐答案

我确实要问你的目的是什么.您是否正在尝试查找并消除性能问题?如果是这样,您所做的任何修复只能在您的代码中.找到它们的一个简单方法是在 IDE 下运行程序,当它运行缓慢时,暂停它并记录调用堆栈.这样做几次.如果有任何代码行出现在多个样本中,则这些样本发生在它请求的工作中,因此如果您能找到避免执行该行代码的方法,您将节省大量时间.调用树可能会显示这样一条线,但要查看它节省了多少时间,您必须对树中出现它的所有分支求和.如果您只是对堆栈进行采样,则没有这个问题.

I do have to ask what is your purpose. Are you trying to find and remove performance problems? If so, any fixes you make can only be in your code. A simple way to find them is to run the program under the IDE and, while it is being slow, pause it and record the call stack. Do this several times. If there is any line of code that appears on multiple samples, those samples are occurring within work being requested by it, so if you can find a way to avoid doing that line of code, you will save a large fraction of time. The call tree may show such a line, but to see how much time it saves, you have to sum over all the branches in the tree where it occurs. You don't have that problem if you just sample the stack.

这里有更完整的解释.

这是一个详细的例子.

有一些误解.性能调优.

这篇关于如何在“调用树"中跟踪.net框架方法在 Visual Studio 中进行分析时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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