寻找好的VC++探查器,已经检查过以前的帖子

发布于 2024-09-05 05:55:56 字数 1539 浏览 1 评论 0原文

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

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

发布评论

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

评论(2

2024-09-12 05:55:56

也许您认为它太基础了,但是如果您想知道哪些代码行通过优化可以为您节省最多时间,手动堆栈采样方法非常有效。

我还建议第 2 点(例程的调用计数和时间)并不完全是您所需要的,如 这篇文章。相反,一条线在感兴趣的时间间隔内的堆栈时间百分比是直接引导您到达“瓶颈”的数字,并且不需要以高统计精度来测量它。

Maybe you consider it too basic, but if you want to know which lines of code would save you the most time by being optimized, the manual stack sampling method is very effective.

I would also suggest that point 2 (call count and time taken by routines) isn't exactly what you need, as in points 6 and 2 of this post. Rather, a line's percent-of-time-on-stack-during-the-interval-of-interest is the number that leads you straight to the "bottlenecks", and it does not need to be measured with high statistical precision.

时光与爱终年不遇 2024-09-12 05:55:56

您可以尝试下载开源分析器(VerySleepy、LukeStackWalker)并查看他们如何对应用程序进行采样,并尝试提取该逻辑。

然后,您的应用程序可以启动第二个线程,该线程除了对主线程(或所有其他线程)进行采样之外什么也不做。

请注意,为了提供可读的结果,您的应用程序应该能够直接访问该文件或通过符号服务器访问调试信息(pdb 文件)。另一种方法是将地址及其计数器转储到文件中,然后在外部实用程序中将地址转换为函数名称。

You could try to download an open source profiler (VerySleepy, LukeStackWalker) and see how they sample an application, and try to extract that logic.

Your application could then start a second thread, which does nothing more than sampling the main thread (or all the other threads).

Notice that in order to give readable results, your application should have access to the debug information (pdb file), either the file directly or via a symbol server. An alternative could be to just dump the addresses with their counters to file, and do the translation of an address to a function name in an external utility.

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