• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Shark - where is application spending most of the time?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shark - where is application spending most of the time?


  • Subject: Re: Shark - where is application spending most of the time?
  • From: Shawn Erickson <email@hidden>
  • Date: Wed, 23 Jun 2004 11:25:06 -0700

On Jun 23, 2004, at 10:27 AM, Izidor Jerebic wrote:

On 23 Jun 2004, at 18:20, Shawn Erickson wrote:

To do what you are asking for you actually have to instrument the application. You will most likely want to look at using Saturn. The CHUD tools have good documentation read over it for an idea of what and how to use them (/Developer/Documentation/CHUD).

-Shawn

On Jun 21, 2004, at 12:25 PM, Izidor Jerebic wrote:

Hello!


But now I became spoiled. Shark only lists functions in two views - tree view (call stack trace) and something called heavy view, which is sorted by the time function itself has consumed (but not its descendants!). I would really like the modified heavy option, that is: functions sorted by the time they and their descendants have consumed, because this would give me insight where the program is spending its time. Right now, with some intuition and some clicking around, I can guess which method I should be looking at. But it would be really nice if the program would show them to me, because it already has all the data, it just needs to display them.




I do not think there is a need for additional work (at least not by me :-))


I would be happy with a very simple method - let Shark just add all the time data from all occurrences of a function/method in the tree view (where you have it already) and display the sorted results as "cumulative heavy" view.

This is what I do now manually :-(

Shark (or sample) doesn't know how much time any of your methods take. It only knows that at x time of a sample each of your threads happened to be at particular instruction in your code and the related call stack (it can of course capture more metrics then just this at sample time). With enough samples you can see which code appears to be running the most often based on the percentage of sample hits a particular instruction/function/call stack gets. It doesn't know true run times or run rates for your functions which I believe is what you are asking for, so don't use sample or Shark but instead instrument and use Saturn or gprof.


To get function run times, run rates, and related metrics you need to instrument the application at compile time. This instrumentation facility is provided by the GCC compiler/tool chain and is what gprof and Saturn use. The Saturn documentation tells you how to configure build options to instrument you application so you can use those tools.

Make sure you understand what the tools are telling you before using any results from them.

-Shawn
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Shark - where is application spending most of the time?
      • From: Izidor Jerebic <email@hidden>
References: 
 >Shark - where is application spending most of the time? (From: Izidor Jerebic <email@hidden>)
 >Re: Shark - where is application spending most of the time? (From: Shawn Erickson <email@hidden>)
 >Re: Shark - where is application spending most of the time? (From: Izidor Jerebic <email@hidden>)

  • Prev by Date: Re: Shark - where is application spending most of the time?
  • Next by Date: Re: Shark - where is application spending most of the time?
  • Previous by thread: Re: Shark - where is application spending most of the time?
  • Next by thread: Re: Shark - where is application spending most of the time?
  • Index(es):
    • Date
    • Thread