The sum of times in my AQTime results don't match up with my measured response times

StackOverflow https://stackoverflow.com/questions/21105593

  •  27-09-2022
  •  | 
  •  

質問

I am working on performance tuning a SAAS product coded in C++. We set microsecond-precision timers at a few points in the code to log how long various actions take, and now I'm trying to use AQTime to dig in further and find the specific bottlenecks in some of our longer-running requests. However, the total time AQTime reports in a given function and its children is less than what our internal timers report. Has anyone experienced this or know why it might occur? Might it have to do with running in a VM? In the handful of functions I've profiled so far, the difference is pretty consistent (AQTime's reported time is about 60% of the time we log from our CPU timer), but I would feel much more reassured if I found out that this has happened to other code bases and it's not just a peculiarity of ours!

Thanks very much!

役に立ちましたか?

解決

This behavior greatly depends on the counter used. If you are using the User or User+Kernel Time counter, AQtime only counts the time spent by CPU to execute your code. The time spent to execute code of other processes or threads is not counted unlike when using manual timers.

The Elapsed Time counter should demonstrate results similar to those you get, but even in this case there can be some differences caused by overhead added by your timer handling code.

You can find more information on different counters' specifics in the Counters Overview topic of the AQtime help system.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top