.Net 中跟踪的工具/最佳实践

发布于 2024-10-09 12:23:16 字数 351 浏览 0 评论 0原文

我正在尝试跟踪一个大型 .net 网站,以找出加载时间为 4 到 5 秒的内容。通常我只是将:

trace="true" 

放在 aspx 页面声明中,然后我就可以从那里缩小范围。

但我遇到的问题是,我需要更缩小所花费时间的范围。现在我只知道 Begin PreRender 和 End PreRender 之间需要 5 秒。

在我开始单步执行每一行并在整个代码中编写跟踪语句之前,是否有一种简单的方法和易于使用的工具来获取一页整个执行的非常详细的日志?它仅适用于我的本地主机,不适用于生产,并且越详细越好。我不在乎日志文件完成后是否有 50MB,我只想看看到底是什么函数花了这么长时间。

I'm trying to trace through a large .net website to find out what's taking 4 to 5 seconds to load. Normally I just put:

trace="true" 

in the aspx page declaration and I'm able to somewhat narrow it down from there.

But the problem I have is that I need it to be more narrow of what's taking so long. Right now I'm only getting that between Begin PreRender and End PreRender it takes 5 seconds.

Before I start stepping through every line and writing tracing statements throughout this code, is there a simple way and an easy to use tool to get a very detailed log of one page's entire execution? It's only for my localhost, not production, and the more detail the better. I don't care if the log file is 50MB when its done, I'd just want to see what exact function is taking so long.

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

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

发布评论

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

评论(4

凉薄对峙 2024-10-16 12:23:16

您可以使用 ANTS 性能分析器

他们在他们的网站上提供 14 天的免费试用。

You can profile the code using the ANTS Performance Profiler.

They have a free 14 day trial on their website.

掩饰不了的爱 2024-10-16 12:23:16

如果您拥有 Visual Studio 2010 的高级版或终极版,则可以使用集成分析器,它可以向您显示程序花费最多时间的方法。

例如,市场上有许多来自第三方供应商的 .NET 分析器Jetbrains dotTrace

If you own the premium or ultimate edition of Visual Studio 2010, you can use the integrated profiler which can show you the methods where your program spends the most time in.

There are many .NET profilers from 3rd party vendors on the market, for example Jetbrains dotTrace.

捎一片雪花 2024-10-16 12:23:16

我使用过Eqatec,它有免费版本。

I've used Eqatec and it has a free version.

枕梦 2024-10-16 12:23:16

您希望了解为什么需要时间。追踪和测量工具是一种常见的方法,但还有另一种方法。

我依赖的方法是这个
听起来很粗糙,但事实并非如此。这是简单说明

如果您想要统计参数,看这里

You want visibility into why it's taking time. Tracing and measuring tools are a common way, but there's another.

The method I rely on is this.
It sounds crude, but it's not. Here's a simple explanation.

If you want the statistical argument, look here.

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