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

CF Performance vs. Foundation (Re: Worth it for an object to cache its own IMPs?)



On 2/03/2004, at 11:46 AM, Scott Stevenson wrote:

> Shark hasn't been very helpful on this particular project as of yet.
> It does tell me generally where the most time is being consumed, but 
> that information wasn't particularly surprising.

Sooo ... what did it say? If it listed Foundation as the big 
performance hog, which methods in particular were bogging you down?

> One of the most valuable aspects of shark seems to be the per-line 
> performance analysis, but at the moment, it's only highlighting one or 
> two lines of code and making them fully yellow with "100%" marker in 
> the leftmost column. I found this particularly strange when it 
> highlighted a line that was simply "++i". The line went away when I 
> changed it to "i++", which seems like a bug. I can't imagine a simple 
> increment like that would be consuming much CPU time anyway, 
> particularly considering all the other complicated stuff going on 
> around it.

By default, Shark samples all processes. So what you're probably seeing 
is that your process used so little processor time that Shark only hit 
it once or twice. In Shark's Profile view, you can check the popup list 
near the bottom of the window to see the distribution of samples 
between processes. If your system is mostly idle, the mach_kernel 
process will probably have about 99% of samples.

To sample your process only, do Shark > Target Process > Attach..., 
select your process and make sure that the "Only sample this 
application" checkbox is checked. That should give you more usable 
performance results.

Cheers,
Tobias Peciva
Pharos Systems