性能瓶颈 - 使用 Visual Studio
我正在寻找一种方法来找到解决方案(很多项目)中的瓶颈方法。
假设我有一个巨大的程序(数千个方法),我想通过查找被多次调用的方法(实际上在运行时使用)并优化它们来提高性能。
我需要这个来解决用 C++、C#、CLI/C++ 编写的复杂问题。 (我可以在调试中编译所有内容并拥有 .pdb 文件)
因此,我正在寻找某种分析器,它可以告诉我每种方法使用了多少 cpu 时间。
我可以在 Visual Studio 中使用什么工具/插件/功能来获取该信息?
我希望能够运行该程序几分钟,然后分析该方法的 cpu 使用情况。或者甚至更好 - cpu 数量/调用次数。
如果我可以按命名空间或 dll/package/project 进行排序,那就更好了。
I'm looking for a way to find bottleneck methods in a solution (lots of projects).
Lets say i have a HUGE program (1000s of methods) and i want to improve performance by finding methods that are called a lot (actually used at runtime), and optimize them.
I need this for a complex problem that's written in C++, C#, CLI/C++. (I can compile it all in debug and have the .pdb files)
So, I'm looking for some kind of analyzer that will tell me how much cpu time each method is using.
What tool/addon/feature can I use in Visual Studio to get that information ?
I want to be able to run the program for a few minutes, and then analyze the method's cpu usage. Or even better - amount of cpu / number of calls.
Would be even better if I could sort by namespace or dll/package/project.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
更昂贵的 Visual Studio 版本应该提供内置探查器:请参阅此线。
然而,还有更多的分析方法,这个主题已经在 stackoverflow 上讨论过很多次了,例如这里。
The more expensive Visual Studio versions should provide a Profiler builtin: see this thread.
However there are more methods to profile, this topic has been covered a lot of times on stackoverflow, here for example.
按照 Christian Goltz 的链接之一,我找到了一个可以执行我想要的操作的程序,它可以分析托管和非托管代码:
AQTime Pro
Following one of Christian Goltz links, I've found a program that might do what I want, it profiles both managed and unmanaged code:
AQTime Pro
我在 JetBrains 的 DotTrace 产品方面获得了一些良好的体验。不确定它是否具有 IDE 集成或您正在寻找的所有功能,但它绝对可以完成工作。
I'm had some good experiences with the DotTrace product by JetBrains. Not sure if it has the IDE integration or all the features that you're looking for, but it definitely gets the job done.
这种方法技术含量较低,但效果很好。
我也在一个巨大的应用程序中工作,当我们遇到性能问题时,它会很快找到它们。
This method is low-tech, but works perfectly well.
I also work in a huge application, and when we have performance problems it finds them quickly.