On 2008-06-09 18:41:23 -0700, "Colin A. Smith" <[EMAIL PROTECTED]> said:
> On Jun 9, 2008, at 17:36, Adam R. Maxwell wrote:
>
>> What did the profiles look like? Was it memory or processor
>> intensive?
>> I'm curious because I've observed tracking rects as a minor
>> performance
>> hit on FileView as well, mainly due to Leopard creating a large number
>> of temporary objects.
>
> I tried profiling once but that didn't seem to turn up anything
> particularly insightful on first glance. There aren't any large spikes
> in CPU usage either. The real problem is with perceived performance
> more than anything else.
Hmmm...IME profiling is the only way to know if a change like this has
an effect, or if you're chasing a red herring. I'd try setting Shark
for a time profile and then scrolling up/down using the trackpad for a
few seconds, then repeat with a malloc trace.
>> Clever :). Does it help at all to do something like [[OFMessageQueue
>> mainQueue] queueSelectorOnce:... for rebuildTrackingRects? That might
>> be more future-proof.
>
> I think that might help a bit but is still going to allow
> rebuildTrackingRects calls while a user is actively scrolling. While
> rebuildTrackingRects is running, nothing else on the main thread can
> run and processing scroll events is significantly poorer. The worst
> case, in which scroll events and rebuildTrackingRects, would still be
> possible.
Right; I forgot that OFMessageQueue is based on NSConditionLock instead
of NSRunloop :/. However, if you used something like this
- (void)scheduleRebuildTrackingRects
{
if (!_scheduledRebuildTrackingRects) {
[self performSelector:@selector(rebuildTrackingRects)
withObject:nil
afterDelay:0 inModes:[NSArray arrayWithObject:NSDefaultRunLoopMode];
_scheduledRebuildTrackingRects = YES;
}
}
- (void)rebuildTrackingRects
{
_scheduledRebuildTrackingRects = NO;
...
}
then it wouldn't rebuild tracking rects while in
NSEventTrackingRunLoopMode, which is what the scrollview should be
using (hypothetically, at least; I use this trick in FileView to deal
with icon scale changes).
--
adam
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Bibdesk-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-develop