[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Puzzling shark output



On Mon, 1 Mar 2004 21:44:27 -0800, Scott Stevenson <sstevenson@xxxxxxx>
wrote:
> If I'm interpreting this right, It looks like Shark has decided that
> the ending curly bracket is taking 100% of the CPU time in this method.
>
> http://treehouseideas.com/downloads/shark/shark1.jpg

If you look at the bottom of the window you'll see that there was only one
sample (you can also click on the "100.0%" and it will toggle to the sample
count). In other words shark only recorded one sample and it just happened
to be at that one location. You need to capture a lot more samples before
you'll have a good picture of where your code is spending its time.

> I'm having a hard time getting reasonable results from Shark. It always
> highlights a single line at 100%, and the line is chooses usually seems
> questionable. Once it chose a simple ++i operation and labeled it 100%.
> This code is inside an embedded framework, if that matters.

The answer is that you're not spending enough time in the framework that
your trying to profile for shark to collect enough data to be very
meaningful. You need to ether increase how often you are sampling or how
long you're collecting data. If you can add code to your project you can
actually have it turn shark on or off so you can narrow the focus on what
you're collecting.

-- 
Enjoy,
George Warner,
Schizophrenic Optimization Scientists
Apple Developer Technical Support (DTS)