Visual Studio 2008 探查器分析 - 缺失时间

发布于 2024-08-23 12:03:35 字数 905 浏览 4 评论 0原文

我针对 ASP.NET 应用程序运行了 Visual Studio 2008 探查器,并得到了以下结果集。

CURRENT FUNCTION                                      TIME (msec)
---------------------------------------------------|--------------
Data.GetItem(params)                               |   10,158.12
---------------------------------------------------|--------------

Functions that were called by Data.GetItem(params)    TIME (msec)
---------------------------------------------------|--------------
Model.GetSubItem(params)                           |     0.83
Model.GetSubItem2(params)                          |     0.77
Model.GetSubItem3(params)                          |     0.76
etc.

我面临的问题是 Data.GetItem(params) 调用的函数总和不等于 10,158.12 毫秒 总数。这让我相信大部分时间实际上都花在了执行该方法中的代码上。

我的问题是...Visual Studio 是否提供了一种分析方法本身的方法,以便我可以看到哪些代码部分花费的时间最长?如果没有,有什么推荐的工具可以做到这一点吗?或者我应该开始编写自己的计时脚本?

谢谢

I ran the Visual Studio 2008 profiler against my ASP.NET application and came up with the following result set.

CURRENT FUNCTION                                      TIME (msec)
---------------------------------------------------|--------------
Data.GetItem(params)                               |   10,158.12
---------------------------------------------------|--------------

Functions that were called by Data.GetItem(params)    TIME (msec)
---------------------------------------------------|--------------
Model.GetSubItem(params)                           |     0.83
Model.GetSubItem2(params)                          |     0.77
Model.GetSubItem3(params)                          |     0.76
etc.

The issue I'm facing is that the sum of the Functions called by Data.GetItem(params) do not sum up to the 10,158.12 msec total. This would lead me to believe that the bulk of the time is actually spent executing the code within that method.

My question is ... does Visual Studio provide a way to analyze the method itself so I can see which sections of code are taking the longest? if it does not are there any recommended tools to do this? or should I start writing my own timing scripts?

Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

你列表最软的妹 2024-08-30 12:03:35

VS 2008 分析器不支持块级分析,但我相信 Red Gate 的分析器 确实如此。

The VS 2008 profiler does not support block level profiling, but I believe that Red Gate's profiler does.

弥枳 2024-08-30 12:03:35

不要专注于对代码进行计时。这就是自上而下的方法。

自下而上的方式更有效。
此方法有效在 Visual Studio 中很好。

Don't concentrate on timing the code. That's the top-down approach.

Bottom-up is way more effective.
This method works just fine in Visual Studio.

说不完的你爱 2024-08-30 12:03:35

另一种方法是将 GetItem 方法分解为许多较小的方法(可能进行二进制切割)以缩小时间花费的范围。可能比编写一些计时脚本更容易。

An another approach would be to break up your GetItem method into a number of smaller methods (perhaps doing a binary chop) to narrow down where the time is being spent. Probably easier than writing some timing scripts.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文