Re: Prioritizing drawing of the important stuff
Re: Prioritizing drawing of the important stuff
- Subject: Re: Prioritizing drawing of the important stuff
- From: Peter Tomaselli <email@hidden>
- Date: Sat, 29 Oct 2016 10:54:30 -0400
Not at all my area of expertise, but I was going to suggest some sort of debounce-style approach as well. That is, there is somewhere an event stream that is firing off “please redraw everything” events (I think you said this was a KVO subscription) at some potentially excessive rate, right?
So I would debounce that twice into two new streams: once to create a “redraw the lightweight stuff” event stream that’s capped at 30 Hz (or whatever), and a second time to create a separate “redraw the slow stuff” event stream at 5 Hz (or whatever).
So, nothing to do with monkeying about with how the system prioritizes drawing internally, instead “sanitizing” your event stream up front based on what you know about the drawing performance characteristics downstream.
Apologies if this is way off base, I have very little experience with Cocoa drawing itself. :)
Peter
> On Oct 29, 2016, at 7:40 AM, Jonathan Taylor <email@hidden> wrote:
>
> The point, though, is that the slider will happily update pretty much as as often as the CPU allows. The issue is how to control what the OS considers to be "smooth enough" slider updates - there's a point at which I'd much rather have it "only" update the slider and the quick-to-draw image 10 times/sec, and have a bit of time spare to do the low-priority drawing, rather than updating the slider and easy image 60 times/sec.
>
>> On 29 Oct 2016, at 12:27, Slipp Douglas Thompson <email@hidden> wrote:
>>
>> You could just set up a simple debounce timer— reset it back to 0sec elapsed time whenever the slider is updated, and if it reaches a small delay then the HQ image is rendered (and remains on-screen until the slider is later moved and the process repeats). No need to rely on GCD or threading.
>>
>> — Slipp
_______________________________________________
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