Re: NSView drawing optimization question
Re: NSView drawing optimization question
- Subject: Re: NSView drawing optimization question
- From: Uli Kusterer <email@hidden>
- Date: Mon, 9 Jul 2007 20:09:52 +0200
On 09.07.2007, at 19:59, Matt Neuburg wrote:
My question is: which is more "optimal"? Assuming this is happening
30 times
a second, is it "better" to redraw a single rectangle, which is
sometimes
fairly small but might sometimes be nearly as large as the entire
view, or
to redraw 18 small rectangles? (You can infer from the scare-quotes
that I'm
not even sure what the goal should be.)
What results did Shark give you when you ran it over your drawing
code? That might provide some helpful information what is better.
It really depends on what these small rectangles are. If they're
small parts of a bigger graphic and you're using clipping, then
drawing this bigger graphic 18 times and just clipping it to small
parts each time will probably be slower. On the other hand, if these
are separate graphics (like LEDs or something) for which a separate
graphic gets drawn and loaded each time, drawing the sub-rects is
generally smaller, because you can probably prevent touching even
the memory pages these graphics are on.
But really, without seeing your drawing code and some shark
results, all we can do is guess vaguely.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
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