AQTime 是如何做到的?
我一直在测试性能和内存分析器 AQTime,看看是否值得花这么多钱对于我的 Delphi 应用程序来说,它是 $$$ 的。
令我惊讶的是,它如何为您提供源行级性能跟踪(包括每行执行的次数以及该行所花费的时间),而无需修改应用程序的源代码,也不会向应用程序添加过多的时间。调试运行。
他们如此高效地做到这一点的方式让我觉得这里可能使用了一些我不知道的技术/技术,了解这些技术/技术会很有用。
你知道他们使用什么样的方法来在不更改代码的情况下逐行捕获执行情况吗?
是否还有其他分析工具也可以进行非侵入式逐行检查,如果是,它们是否使用相同的技术?
I've been testing out the performance and memory profiler AQTime to see if it's worthwhile spending those big $$$ for it for my Delphi application.
What amazes me is how it can give you source line level performance tracing (which includes the number of times each line was executed and the amount of time that line took) without modifying the application's source code and without adding an inordinate amount of time to the debug run.
The way that they do this so efficiently makes me think there might be some techniques/technologies used here that I don't know about that would be useful to know about.
Do you know what kind of methods they use to capture the execution line-by-line without code changes?
Are there other profiling tools that also do non-invasive line-by-line checking and if so, do they use the same techniques?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我为 Delphi 制作了一个开源分析器,它的作用相同:
http://code.google.com/p/asmprofiler/
虽然并不完美,但也很完美自由的 :-)。 也是采用Detour技术。
它存储每个调用(您必须手动设置要分析的功能),
因此它可以创建精确的呼叫历史记录树,包括时间表(!)。
I've made an open source profiler for Delphi which does the same:
http://code.google.com/p/asmprofiler/
It's not perfect, but it's free :-). Is also uses the Detour technique.
It stores every call (you must manual set which functions you want to profile),
so it can make an exact call history tree, including a time chart (!).
这只是猜测,但也许 AQtime 基于类似于 Microsoft Detours 的技术?
This is just speculation, but perhaps AQtime is based on a technology that is similar to Microsoft Detours?
我对 Delphi 不太了解,但 C 应用程序调试器可以相对轻松地进行逐行分析 - 它可以加载代码并将每个代码路径与代码块相关联。 然后它可以中断所有条件跳转指令,并观察并查看采用了什么代码路径。 像 gdb 这样的调试器可以相对高效地运行,因为它们通过内核工作并且不修改代码,它们只是在执行每一行时得到通知。 如果某些原因导致块提前退出(longjmp),调试器可以挂钩它并计算出它发生时进入块的程度,并仅增加这些行。
当然,编码仍然很困难,但是当我说“轻松”时,我的意思是您可以做到这一点,而无需浪费时间破坏每条指令来更新计数器。
I don't know about Delphi in particular, but a C application debugger can do line-by-line profiling relatively easily - it can load the code and associate every code path with a block of code. Then it can break on all the conditional jump instructions and just watch and see what code path is taken. Debuggers like gdb can operate relatively efficiently because they work through the kernel and don't modify the code, they just get informed when each line is executed. If something causes the block to be exited early (longjmp), the debugger can hook that and figure out how far it got into the blocks when it happened and increment only those lines.
Of course, it would still be tough to code, but when I say easily I mean that you could do it without wasting time breaking on each and every instruction to update a counter.
早已不复存在的 TurboPower 还有一个出色的 Delphi 分析/分析工具,称为 Sleuth QA Suite。 我发现它比 AQTime 简单得多,但也更容易获得有意义的结果。 也许值得尝试追踪 - eBay,也许?
The long-since-defunct TurboPower also had a great profiling/analysis tool for Delphi called Sleuth QA Suite. I found it a lot simpler than AQTime, but also far easier to get meaningful result. Might be worth trying to track down - eBay, maybe?