Re: 10.8 copiesOnScroll, -setNeedsDisplayInRect: ignored during scrolling
Re: 10.8 copiesOnScroll, -setNeedsDisplayInRect: ignored during scrolling
- Subject: Re: 10.8 copiesOnScroll, -setNeedsDisplayInRect: ignored during scrolling
- From: Kyle Sluder <email@hidden>
- Date: Mon, 06 Aug 2012 17:47:57 -0700
On Mon, Aug 6, 2012, at 05:34 PM, Dave Keck wrote:
> > But Mike is still right; you're probably better served by using -performSelectorOnMainThread::: rather than waking the run loop up yourself.
>
> I tend to disagree -- invoking CFRunLoopPerformBlock() and
> CFRunLoopWakeUp() is likely more performant since they're at the CF
> level (which -performSelectorOnMainThread eventually calls into), and
> a block-based API is more convenient. Furthermore,
> -performSelectorOnMainThread: wakes up the target run loop anyway by
> invoking CFRunLoopWakeUp().
You're thunking across a thread boundary; whatever performance
improvement you're imagining (unless you've already measured your
performance?) is certainly overshadowed by thread synchronization.
>
> > Given that it's a private mode, I'm not sure you really want your code executing during the scroll event coalescing mode.
>
> Agreed -- I wasn't using nor advocating NSScrollEventCoallescing.
> (Also note that calling CFRunLoopWakeUp() on the main thread while
> it's running in the NSScrollEventCoallescing mode won't cause it to
> execute the block passed to CFRunLoopPerformBlock(...,
> kCFRunLoopDefaultMode, ...) until the run loop is again running in the
> default mode.)
This is true; I overlooked this.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden