CPU profiling not recording Thread.Sleep time?

Questions about YourKit .NET Profiler
Post Reply
Tobbe
Posts: 72
Joined: Thu Feb 21, 2008 11:08 am

CPU profiling not recording Thread.Sleep time?

Post by Tobbe »

Is CPU profiling not recording Thread.Sleep time? Running 304 version and cant find my thread.sleep timeout.
Anton Katilin (YourKit)
Posts: 157
Joined: Wed Aug 15, 2007 9:09 pm

Post by Anton Katilin (YourKit) »

Record time is a thread CPU time.
Tobbe
Posts: 72
Joined: Thu Feb 21, 2008 11:08 am

Post by Tobbe »

I dont understand your answer.

Are you say that when a Thread.Sleep is invoked from my code, lets say someone puts a 10000ms. Im not able to see it in the profiler?
Tobbe
Posts: 72
Joined: Thu Feb 21, 2008 11:08 am

Post by Tobbe »

To clarify
Im not able to see it in the profiler?
- Have a Form with a button.
- Button_Click results in a Thread.Sleep(10000)
- No Filters in yourkit!
- Cpu/Call Tree/Time(ms) = 906ms (100%)

Shouldnt it say 10906ms (100%)? And i would see that the 10000ms is spent in Button_Click?

I dont even show up in Hot spots!?
Tobbe
Posts: 72
Joined: Thu Feb 21, 2008 11:08 am

Post by Tobbe »

I dont even show up in Hot spots!?
:oops: Correction: It dont even show up in Hot spots!? :oops:
Vladimir Kondratyev
Posts: 1624
Joined: Tue Aug 10, 2004 7:52 pm

Post by Vladimir Kondratyev »

Anton said, that only really consumed CPU time is measured. If the thread is sleeping, it doesn't consume any CPU resource and measured time will be 0. CPU time is not the same as wall time you are measured by stopwatch. That's why you do not see Thread.Sleep()

Best regards,
Vladimir Kondratyev
YourKit, LLC
http://www.yourkit.com
"Don't get lost in data, get information!"
Tobbe
Posts: 72
Joined: Thu Feb 21, 2008 11:08 am

Post by Tobbe »

Ok, is there any way to profile by "wall time" in yourkit? I thought that the ms presented was the actuall time a metod call cost?
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Post by Anton Katilin »

Currently consumed CPU time is measured. We'll add an option for a wall time too.
Tobbe
Posts: 72
Joined: Thu Feb 21, 2008 11:08 am

Post by Tobbe »

:D Looking forward to it!
dabrammertz
Posts: 2
Joined: Tue Feb 26, 2008 8:01 pm

Post by dabrammertz »

I'm looking forward to that feature too. I just had a problem with a big performance leak caused by a slow database query. YourKit-Profiler couldn't give me any hint on this issue, since waiting for the database was no cpu time.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Post by Anton Katilin »

I'm looking forward to that feature too. I just had a problem with a big performance leak caused by a slow database query. YourKit-Profiler couldn't give me any hint on this issue, since waiting for the database was no cpu time.
What is the exact class and method which you expect to measure that way?
dabrammertz
Posts: 2
Joined: Tue Feb 26, 2008 8:01 pm

Post by dabrammertz »

It ended up in System.Data.Odbc.OdbcCommand.ExecuteReader() for which the CPU-Time was just some milliseconds. This lead me to the misconclusion that the problem could not be related to a slow database query, and i fixed all sorts of other bottlenecks, but which in total did not bring any big difference, since the real problem was much bigger. Finally two Log-Messages around the ExecuteReader() showed me that this statement took two seconds, since the database query was too complicated.
So a feature like "wall time" would be really helpfull for this kind of problems.
Tobbe
Posts: 72
Joined: Thu Feb 21, 2008 11:08 am

Post by Tobbe »

Hi again

Any progress regarding recording with wall time?
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Post by Anton Katilin »

Hello,

We have added corresponding feature request of high priority.
ppietrus
Posts: 1
Joined: Fri Sep 19, 2008 8:21 pm

Re: CPU profiling not recording Thread.Sleep time?

Post by ppietrus »

Hey,
Is there any ETA on that feature? It would be important for us as well.
Thanks,
Pawel
Post Reply