0

I'm trying to profile an app in c#, never done any kind of profiling before. I haven't been able to find much documentation on the profiler so far maybe someone here might know better.

I have an app that when I click a toolbar button, kicks off a background thread to fetch me some data. The data is then prepared and displayed on the Main thread. I'm trying to profile this process to determine whether the time taken is in the preparation of the data or in the fetching, but I'm not having much luck. If I use the Sampling mode, it only displays the Main thread, if I use the Concurrency view, it gives me a load of information that I'm not after like contention etc.

Cheers if anyone knows something that could help!

Alex

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
AlexC
  • 1,646
  • 1
  • 14
  • 26
  • Are you sure it isn't sampling the other thread? I wouldn't expect a sampling profiler to restrict itself to reporting a single thread. – Marcelo Cantos Jun 25 '10 at 13:29
  • It doesn't seem to be - can't see the method that goes and gets the data anywhere in the samples. – AlexC Jun 25 '10 at 13:34

1 Answers1

1

The VS sampler is suspended during I/O, so if a thread spends nearly all its time in I/O, it will appear to be spending almost no time at all. On the other hand, instrumentation should catch it.

My favorite method is to just pause it while it's working, and examine any thread you like.

Community
  • 1
  • 1
Mike Dunlavey
  • 40,059
  • 14
  • 91
  • 135