AQTime 是如何做到的?

发布于 2024-07-09 15:07:28 字数 392 浏览 8 评论 0原文

我一直在测试性能和内存分析器 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 技术交流群。

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

发布评论

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

评论(4

情独悲 2024-07-16 15:07:28

我为 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 (!).

乖乖兔^ω^ 2024-07-16 15:07:28

这只是猜测,但也许 AQtime 基于类似于 Microsoft Detours 的技术?

Detours 是一个用于检测的库
x86、x64 上的任意 Win32 函数、
和 IA64 机器。 绕行拦截
Win32 函数通过重写
目标函数的内存中代码。

This is just speculation, but perhaps AQtime is based on a technology that is similar to Microsoft Detours?

Detours is a library for instrumenting
arbitrary Win32 functions on x86, x64,
and IA64 machines. Detours intercepts
Win32 functions by re-writing the
in-memory code for target functions.

若相惜即相离 2024-07-16 15:07:28

我对 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.

渔村楼浪 2024-07-16 15:07:28

早已不复存在的 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?

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