How Does AQTime Do It?

后端 未结 4 871
庸人自扰
庸人自扰 2021-01-04 09:23

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

4条回答
  •  隐瞒了意图╮
    2021-01-04 10:04

    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.

提交回复
热议问题