有哪些好的 .NET 分析器?

发布于 2024-07-05 10:42:40 字数 37 浏览 7 评论 0 原文

您在使用 .net 程序时使用过哪些分析器,您特别推荐哪个?

What profilers have you used when working with .net programs, and which would you particularly recommend?

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

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

发布评论

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

评论(30

离不开的别离 2024-07-12 10:42:40

其他人已经介绍了性能分析,但是关于内存分析
我目前正在评估 Scitech .NET Memory Profiler 3.1 和 ANTS Memory Profiler 5.1(截至 2009 年 9 月的当前版本)。 我在一两年前尝试过 JetBrains,它不如 ANTS(用于内存分析),所以这次我没有打扰。 从阅读网站来看,它似乎没有与其他两个相同的内存分析功能。

ANTS 和 Scitech 内存分析器都具有对方没有的功能,因此哪个最好取决于您的喜好。 一般来说,Scitech 提供了更详细的信息,而 ANTS 则在识别泄漏对象方面确实令人难以置信。 总的来说,我更喜欢 ANTS,因为它能够快速识别可能的泄漏。

根据我的经验,以下是每种方法的主要优缺点:

ANTS 和 Scitech .NET Memory Profiler 的共同功能

  • 实时分析功能
  • 其网站上有出色的操作视频
  • 易于使用
  • 性能合理(显然比没有附加探查器慢,但不会让你感到沮丧)
  • 显示泄漏对象的实例
  • 基本上它们都很好地完成工作

ANTS

  • 一键过滤器来查找常见泄漏< /strong> 包括:仅由事件处理程序保持活动状态的对象、已处置但仍处于活动状态的对象以及仅通过已处置对象的引用保持活动状态的对象。 这可能是 ANTS 的杀手级功能 - 因此发现泄漏的速度非常快。 根据我的经验,大多数泄漏是由于事件处理程序未解除挂钩而引起的,而 ANTS 只是将您直接带到这些对象。 惊人的。
  • 对象保留图。 虽然 Scitech 中提供了相同的信息,但在 ANTS 中解释起来要容易得多。
  • 除了对象本身的大小之外,还显示子对象的大小(但不幸的是,仅当选择实例时,而不是在整个类列表中)。
  • 与 Visual Studio 更好的集成(右键单击图形可跳转到文件)

Scitech .NET Memory Profiler

  • 显示分配对象时的堆栈跟踪。 这对于分配在许多不同位置的对象确实非常有用。 使用 ANTS 很难准确确定泄漏对象的创建位置。
  • 显示未处理的一次性物品的数量。 虽然并不表示存在泄漏,但它确实发现了解决此问题并通过更快的垃圾收集来提高应用程序性能的机会。
  • 更详细的过滤选项(可以独立过滤几列)。
  • 显示有关创建的对象总数(包括垃圾收集的对象)的信息。 ANTS 仅显示“实时”对象统计数据。 这使得分析和调整整体应用程序性能变得更加容易(例如,识别在哪里不必要地创建了许多不一定会泄漏的对象)。

总而言之,我认为 ANTS 可以帮助您更快地找到泄漏的内容,而一旦您知道要查看什么(例如创建时的堆栈跟踪),Scitech 就会提供有关整体应用程序内存性能和各个对象的更多详细信息。 如果将堆栈跟踪和未处理一次性对象的跟踪添加到 ANTS 中,我认为不需要使用其他任何东西。

Others have covered performance profiling, but with regards to memory profiling
I'm currently evaluating both the Scitech .NET Memory Profiler 3.1 and ANTS Memory Profiler 5.1 (current versions as of September 2009). I tried the JetBrains one a year or two ago and it wasn't as good as ANTS (for memory profiling) so I haven't bothered this time. From reading the web sites it looks like it doesn't have the same memory profiling features as the other two.

Both ANTS and the Scitech memory profiler have features that the other doesn't, so which is best will depend upon your preferences. Generally speaking, the Scitech one provides more detailed information while the ANTS one is really incredible at identifying the leaking object. Overall, I prefer the ANTS one because it is so quick at identifying possible leaks.

Here are the main the pros and cons of each from my experience:

Common Features of ANTS and Scitech .NET Memory Profiler

  • Real-time analysis feature
  • Excellent how-to videos on their web sites
  • Easy to use
  • Reasonably performant (obviously slower than without the profiler attached, but not so much you become frustrated)
  • Show instances of leaking objects
  • Basically they both do the job pretty well

ANTS

  • One-click filters to find common leaks including: objects kept alive only by event handlers, objects that are disposed but still live and objects that are only being kept alive by a reference from a disposed object. This is probably the killer feature of ANTS - finding leaks is incredibly fast because of this. In my experience, the majority of leaks are caused by event handlers not being unhooked and ANTS just takes you straight to these objects. Awesome.
  • Object retention graph. While the same info is available in Scitech, it's much easier to interpret in ANTS.
  • Shows size with children in addition to size of the object itself (but only when an instance is selected unfortunately, not in the overall class list).
  • Better integration to Visual Studio (right-click on graph to jump to file)

Scitech .NET Memory Profiler

  • Shows stack trace when object was allocated. This is really useful for objects that are allocated in lots of different places. With ANTS it is difficult to determine exactly where the leaked object was created.
  • Shows count of disposable objects that were not disposed. While not indicative of a leak, it does identify opportunities to fix this problem and improve your application performance as a result of faster garbage collection.
  • More detailed filtering options (several columns can be filtered independently).
  • Presents info on total objects created (including those garbage collected). ANTS only shows 'live' object stats. This makes it easier to analyze and tune overall application performance (eg. identify where lots of objects being created unnecessarily that aren't necessarily leaking).

By way of summary, I think ANTS helps you find what's leaking faster while Scitech provides a bit more detail about your overall application memory performance and individual objects once you know what to look at (eg. stack trace on creation). If the stack trace and tracking of undisposed disposable objects was added to ANTS I wouldn't see the need to use anything else.

风和你 2024-07-12 10:42:40

我使用过 JetBrains dotTraceRedgate ANTS 广泛。 它们在功能和价格上非常相似。 它们都提供有用的性能分析和相当基本的内存分析。

dotTrace 与 Resharper 集成,这非常方便,因为您只需从 IDE 中单击一下即可分析单元测试的性能。 然而,dotTrace 似乎经常给出虚假结果(例如,说某个方法需要几年时间才能运行),

我更喜欢 ANTS 呈现分析结果的方式。 它向您显示源代码,并在每行左侧告诉您运行需要多长时间。 dotTrace 只有一个树视图。

EQATEC profiler 非常基本,需要您编译程序集的特殊检测版本,然后可以在其中运行EQATEC 分析器。 然而,它是免费的。

总的来说,我更喜欢 ANTS 进行性能分析,尽管如果您使用 Resharper,那么 dotTrace 的集成是一个杀手级功能,意味着它在可用性方面胜过 ANTS。

免费的 Microsoft CLR Profiler (.Net Framework 2.0 / .Net Framework 4.0) 是您所需的全部。 NET 内存分析。

2011 更新:

Scitech 内存分析器 有一个相当基本的 UI,但有很多有用的信息,包括dotTrace 和 ANTS 缺乏的有关非托管内存的一些信息 - 如果您正在进行 COM 互操作,您可能会发现它很有用,但我还没有找到任何分析器可以使 COM 内存问题易于诊断 - 您通常必须突破 windbg .exe

ANTS 分析器在过去几年中取得了突飞猛进的发展,它的内存分析器具有一些真正有用的功能,据我估计,这些功能现在使其作为一个软件包领先于 dotTrace。 我很幸运拥有两者的许可证,但如果您打算购买一个 .Net 分析器来兼顾性能和内存,那就让它成为蚂蚁吧。

I have used JetBrains dotTrace and Redgate ANTS extensively. They are fairly similar in features and price. They both offer useful performance profiling and quite basic memory profiling.

dotTrace integrates with Resharper, which is really convenient, as you can profile the performance of a unit test with one click from the IDE. However, dotTrace often seems to give spurious results (e.g. saying that a method took several years to run)

I prefer the way that ANTS presents the profiling results. It shows you the source code and to the left of each line tells you how long it took to run. dotTrace just has a tree view.

EQATEC profiler is quite basic and requires you to compile special instrumented versions of your assemblies which can then be run in the EQATEC profiler. It is, however, free.

Overall I prefer ANTS for performance profiling, although if you use Resharper then the integration of dotTrace is a killer feature and means it beats ANTS in usability.

The free Microsoft CLR Profiler (.Net framework 2.0 / .Net Framework 4.0) is all you need for .NET memory profiling.

2011 Update:

The Scitech memory profiler has quite a basic UI but lots of useful information, including some information on unmanaged memory which dotTrace and ANTS lack - you might find it useful if you are doing COM interop, but I have yet to find any profiler that makes COM memory issues easy to diagnose - you usually have to break out windbg.exe.

The ANTS profiler has come on in leaps and bounds in the last few years, and its memory profiler has some truly useful features which now pushed it ahead of dotTrace as a package in my estimation. I'm lucky enough to have licenses for both, but if you are going to buy one .Net profiler for both performance and memory, make it ANTS.

鱼窥荷 2024-07-12 10:42:40

我想补充一点,dotTrace 比较内存和性能跟踪会话的能力绝对是无价的(ANTS 可能也有内存比较功能,但我没有看到性能差异)。

能够在错误修复或增强之前和之后运行分析会话,然后比较结果是非常有价值的,特别是对于庞大的遗留 .NET 应用程序(如我的例子),其中性能从来都不是优先考虑的问题,而查找瓶颈可能是最重要的非常乏味。 通过进行前后比较,您可以查看每种方法的调用次数变化以及每种方法的持续时间变化

这不仅在代码更改期间很有帮助,而且如果您有一个为每个客户端/客户使用不同数据库的应用程序,这也很有帮助。 如果一位客户抱怨速度缓慢,您可以使用他们的数据库运行分析会话,并将结果与​​“快速”数据库进行比较,以确定哪些操作导致速度缓慢。 当然,有许多数据库端性能工具,但有时我确实有助于从应用程序端查看性能指标(因为这更接近用户实际看到的情况)。

底线:dotTrace 效果很好,而且差异非常宝贵。

I would add that dotTrace's ability to diff memory and performance trace sessions is absolutely invaluable (ANTS may also have a memory diff feature, but I didn't see a performance diff).

Being able to run a profiling session before and after a bug fix or enhancement, then compare the results is incredibly valuable, especially with a mammoth legacy .NET application (as in my case) where performance was never a priority and where finding bottlenecks could be VERY tedious. Doing a before-and-after diff allows you to see the change in call count for each method and the change in duration for each method.

This is helpful not only during code changes, but also if you have an application that uses a different database, say, for each client/customer. If one customer complains of slowness, you can run a profiling session using their database and compare the results with a "fast" database to determine which operations are contributing to the slowness. Of course there are many database-side performance tools, but sometimes I really helps to see the performance metrics from the application side (since that's closer to what the user's actually seeing).

Bottom line: dotTrace works great, and the diff is invaluable.

ぇ气 2024-07-12 10:42:40

AQTime 是合理的,但有一点学习曲线并且不太容易作为 Team Suite 中的内置组件使用

AQTime is reasonable, but has a bit of a learning curve and isn't as easy to use as the built in one in Team Suite

少女七分熟 2024-07-12 10:42:40

过去,我使用过 Visual Studio Team System 附带的分析器。

In the past, I’ve used the profiler that ships with Visual Studio Team System.

海夕 2024-07-12 10:42:40

当前版本的 SharpDevelop (3.1.1) 有一个很好的集成分析器。 它的速度相当快,并且可以很好地集成到 SharpDevelop IDE 及其 NUnit 运行程序中。 结果以灵活的树/列表样式显示(使用 LINQ 创建您自己的选择)。 双击显示的方法直接跳转到源代码。

The current release of SharpDevelop (3.1.1) has a nice integrated profiler. It's quite fast, and integrates very well into the SharpDevelop IDE and its NUnit runner. Results are displayed in a flexible Tree/List style (use LINQ to create your own selection). Doubleclicking the displayed method jumps directly into the source code.

美人骨 2024-07-12 10:42:40

我过去曾使用过 RedGate 的分析器。 为我做了这份工作。

I've worked with RedGate's profiler in the past. Did the job for me.

讽刺将军 2024-07-12 10:42:40

我自己还没有尝试过,但也许dotTrace? 他们的 ReSharper 应用程序无疑是一款不错的应用程序。 也许 dotTrace 也是:)

Haven't tried it myself, but maybe dotTrace? Their ReSharper application is certainly a good one. Maybe dotTrace is too :)

醉态萌生 2024-07-12 10:42:40

我怀疑 Visual Studio Team System 附带的分析器是否是最好的分析器,但我发现它在很多情况下都足够好。 除了 VS 提供的功能之外,您还需要什么?

编辑:不幸的是,它仅在 VS Team System 中可用,但如果您有权访问它,则值得一试。

I doubt that the profiler which comes with Visual Studio Team System is the best profiler, but I have found it to be good enough on many occasions. What specifically do you need beyond what VS offers?

EDIT: Unfortunately it is only available in VS Team System, but if you have access to that it is worth checking out.

过去的过去 2024-07-12 10:42:40

最新版本的 ANTS 内存分析器(我认为是 5)简直太棒了!!! 我一直在使用 WinDbg 和 SOS 来解决泄漏问题,因为它被证明是之前最好的方法,然后我尝试了 ANTS,几分钟之内就得到了它。 确实是一个很棒的软件。

The latest version of ANTS memory profiler (I think it's 5) simply rocks!!! I was haunting a leak using WinDbg and SOS since it proved to be the best way before, then I tried ANTS and I got it in minutes. Really a wonderful piece of software.

我不是你的备胎 2024-07-12 10:42:40

我想添加 yourkit java 和 .net 分析器,我喜欢 Java,还没有尝试过。 NET 版本。

I would like to add yourkit java and .net profiler, I love it for Java, haven't tried .NET version though.

琴流音 2024-07-12 10:42:40

不幸的是,我尝试的大多数分析器在与尾部调用一起使用时都失败了,尤其是 ANTS。 我最终只是写自己的。 CodeProject 上有一个简单的实现,您可以将其用作基础。

Unfortunate most of the profilers I tried failed when used with tail calls, most notably ANTS. I just end up writing my own. There is a simple implementation on CodeProject that you can use as a base.

总攻大人 2024-07-12 10:42:40

我必须给你带来一个我以前用过的神奇工具。 AVICode Interceptor Studio。 在我以前的公司中,我们使用这个出色的工具来分析 Web 应用程序(这应该是世界上最大的 Web 应用程序,也是有史以来最大的民用 IT 项目)。 表演团队在这个出色的工具的帮助下创造了奇迹。 配置它很痛苦,但这是一次性活动,我想说这是值得的。 请查看此页面了解详细信息。

谢谢,
詹姆士

I must bring an amazing tool to your notice which i have used sometime back. AVICode Interceptor Studio. In my previous company we used this wonderful tool to profile the webapplication (This is supposed to be the single largest web application in the world and the largest civilian IT project ever done). The performance team did wonders with the help of this magnificent tool. It is a pain to configure it, but that is a one time activity and i would say it is worth the time. Checkout this page for details.

Thanks,
James

殊姿 2024-07-12 10:42:40

对我来说,SpeedTrace 是市场上最好的工具,因为它不仅可以帮助您找到应用程序内部的瓶颈。 它还可以帮助您在故障排除场景中找出应用程序崩溃的原因、安装程序未安装、应用程序挂起、应用程序性能有时很差(具体取决于数据输入),例如识别缓慢的数据库事务。

For me SpeedTrace is the best tool on the market because it does not only help you to find bottlenecks inside your applications. It also helps you in troubleshooting scenarios to find out why your application was crashing, your setup did not install, your application hung up, your application performance is sometimes poor depending on the data input, e.g. to identify slow db transactions.

離殇 2024-07-12 10:42:40

我最近一直在测试 Telerik 的 JustTrace,尽管它距离成品还很远,但人们正在朝着正确的方向前进。

I've been testing Telerik's JustTrace recently and although it is well away from a finished product the guys are going in the right direction.

吲‖鸣 2024-07-12 10:42:40

如果许可是一个问题,您可以尝试使用 WINDBG 进行内存分析

If Licensing is an issue you could try WINDBG for memory profiling

離人涙 2024-07-12 10:42:40

NuMega True Time 分析器位于 Micro Focus 的 DevPartner Studio 中。 它为仅需要 PDB 的 .NET 应用程序提供行和方法级别的详细信息,无需任何源(但它有帮助)。它可以使用我们专有的每线程内核模式定时驱动程序区分算法繁重的例程与具有长 I/O 等待的例程。 10.5 版于 2011 年 2 月 4 日发布了新的 64 进程支持。 无耻插件:我在 DevPartner 产品线工作。 请关注 http://www.DevPartner.com 了解 10.5 发布的新闻。

免责声明:我是 Micro Focus 开发合作伙伴的产品经理。

The NuMega True Time profiler lives on in DevPartner Studio by Micro Focus. It provides line and method level detail for .NET apps requiring only PDBs, no source needed (but it helps.) It can discriminate between algorithmically heavy routines versus those with long I/O waits using our proprietary per thread kernel mode timing driver. Version 10.5 ships with new 64-process support on February 4, 2011. Shameless plug: I work on the DevPartner product line. Follow up at http://www.DevPartner.com for news of the 10.5 launch.

Disclaimer: I am the Product Manager for DevPartner at Micro Focus.

稚然 2024-07-12 10:42:40

我在使用 这个

通常,问题发生在启动或关闭期间,因为加载插件以及创建、销毁、序列化或反序列化大数据结构。 通常它们会被多次创建和初始化,并且更改处理程序会被多次添加,从而进一步加剧问题。

在这种情况下,程序可能会非常缓慢,以至于只有 2 个样本就足以查明有问题的方法/函数/属性调用站点。

I've found plenty of problems in a big C# app using this.

Usually the problem occurs during startup or shutdown as plugins are being loaded, and big data structures are being created, destroyed, serialized, or deserialized. Often they are created and initialized more than once, and change handlers get added multiple times, further compounding the problem.

In cases like this, the program can be so sluggish that only 2 samples are sufficient to pinpoint the guilty method / function / property call sites.

傲性难收 2024-07-12 10:42:40

我们在我的公司选择了 YourKit Profiler for .NET,因为它具有最佳价值(价格与功能)。 对于一家想要灵活许可(浮动许可)的小公司来说,这是一个完美的选择 - ANTS 当时是开发者席位。

此外,它还为我们提供了附加到正在运行的进程的能力,这是 dotTrace 无法实现的。 请注意,虽然附加并不是最好的选择,因为 .NET 的所有内容都会变慢,但这是分析由其他进程启动的 .NET 应用程序的唯一方法。
就功能而言,ANTS 和 dotTrace 更好 - 但最终 YourKit 已经足够好了。

We selected YourKit Profiler for .NET in my company as it was the best value (price vs. feature). For a small company that wants to have flexible licensing (floating licenses) it was a perfect choice - ANTS was developer seat locket at the time.

Also, it provided us with the ability to attach to the running process which was not possible with dotTrace. Beware though that attaching is not the best option as everything .NET will slow down, but this was the only way to profile .NET applications started by other processes.
Feature wise, ANTS and dotTrace were better - but in the end YourKit was good enough.

伪装你 2024-07-12 10:42:40

如果您使用 ASP.NET MVC,则可以尝试 MVCMiniProfiler (http://benjii.me/2011/07/using-the-mvc-mini-profiler-with-entity-framework/)

If you're on ASP.NET MVC, you can try MVCMiniProfiler (http://benjii.me/2011/07/using-the-mvc-mini-profiler-with-entity-framework/)

深居我梦 2024-07-12 10:42:40

我最近发现了 EQATEC Profiler http://www.eqatec.com/tools/profiler。 它适用于大多数 .NET 版本和许多平台。 它易于使用,并且部分内容是免费的,即使用于商业用途也是如此。

I recently discovered EQATEC Profiler http://www.eqatec.com/tools/profiler. It works with most .NET versions and on a bunch of platforms. It is easy to use and parts of it is free, even for commercial use.

情未る 2024-07-12 10:42:40

[全面披露]

虽然还没有像其他一些 .NET 内存那样功能齐全除了此处列出的分析器之外,市场上还有一个名为 JustTrace 的新条目。 它由 Telerik 制作,其主要目标是使所有类型的应用程序(Web/Silverlight/桌面)的跟踪/分析变得更容易、更快捷。

如果您发现其他工具的分析和优化令人生畏或速度缓慢,那么 JustTrace 可能值得一试看。

[Full Disclosure]

While not yet as full-featured as some of the other .NET memory profilers listed here, there is a new entry on the market called JustTrace. It's made by Telerik and it's primary goal is to make tracing/profiling easier and faster to do for all types of apps (web/Silverlight/desktop).

If you've ever found profiling and optimization intimidating or slow with other tools, then JustTrace might be worth a look.

冷月断魂刀 2024-07-12 10:42:40

不要忘记 nProf - 一个非常好的、免费软件分析器。

Don't forget nProf - a prefectly good, freeware profiler.

小女人ら 2024-07-12 10:42:40

我找到了 dotTrace Profiler by JetBrains 是一款出色的 .NET 分析工具,其 ASP.NET 模式非常出色。

I have found dotTrace Profiler by JetBrains to be an excellent profiling tool for .NET and their ASP.NET mode is quality.

明月夜 2024-07-12 10:42:40

ANTS 分析器。 我没用过很多,但我对ANTS确实没有任何抱怨。 可视化确实很有帮助。

ANTS Profiler. I haven't used many, but I don't really have any complaints about ANTS. The visualization is really helpful.

江南月 2024-07-12 10:42:40

AutomatedQA AQTime 用于计时和 SciTech MemProfiler 用于内存。

AutomatedQA AQTime for timing and SciTech MemProfiler for memory.

秋心╮凉 2024-07-12 10:42:40

如果您正在寻找快速、简单且免费的工具,http://code.google.com/ p/slimtune/ 似乎做得很好。

If you're looking for something quick, easy, and free, http://code.google.com/p/slimtune/ seems to do the job fine.

东京女 2024-07-12 10:42:40

我一直在使用 JetBrains dotTrace for WinForms 和控制台应用程序(尚未在 ASP.net 上进行测试) ),而且效果很好:

他们最近还添加了“个人许可证”,比公司许可证便宜得多。 不过,如果其他人知道一些更便宜甚至免费的,我也想听听:-)

I've been working with JetBrains dotTrace for WinForms and Console Apps (not tested on ASP.net yet), and it works quite well:

They recently also added a "Personal License" that is significantly cheaper than the corporate one. Still, if anyone else knows some cheaper or even free ones, I'd like to hear as well :-)

殤城〤 2024-07-12 10:42:40

不要忘记令人敬畏的 scitech .net 内存分析器

它非常适合跟踪您的 .net 应用程序耗尽内存的原因记忆。

Don't forget the awesome scitech .net memory profiler

It's great for tracking down why your .net app is running out of memory.

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