How do I interpret the output of Mac's 'sample' tool

I just checked the Man page on sample and it looks to me like a half-decent call-stack sampler. It claims that its output is the call-tree, so that should not be too hard to comprehend.

I say half-decent because collecting call-stack samples is a good thing. The criticisms are:

  1. It doesn't say if it collects samples when the process is in a system call, like waiting for I/O. It is important to do so, unless you want to be blind to needless I/O.

  2. It falls for the fiction that what matters is accuracy of timing and you don't want to miss any functions, so samples have to be really frequent. It's a fiction because the goal is to find big stuff, not to measure little stuff. Any function that doesn't appear certainly doesn't cost enough to care about.
    The consequence of this fiction is there are too many samples for you to look at, so it has to try to find a way to summarize them, so it chooses a call-tree. The fact is, if you are allowed to actually examine a small number of the samples (like 10 or 20) you will see exactly the reason(s) for the slowness. The summarization is the problem. It smears out and hides the information.

So, the long-and-short is, it appears to be a good tool for collecting call-stack samples. If you can figure out how to actually see a selection of them, it will tell you what the problem is.