Re: iPhoto-like scroll view
Re: iPhoto-like scroll view
- Subject: Re: iPhoto-like scroll view
- From: Torsten Curdt <email@hidden>
- Date: Sat, 8 Sep 2007 15:46:51 +0200
On 08.09.2007, at 04:09, Thomas Davie wrote:
On 8 Sep 2007, at 02:52, Torsten Curdt wrote:
I am currently experimenting with a custom view that basically
shows thumbnails like iPhoto does. Now while the basic drawing is
still terrible inefficient (loads NSImages on every drawRect(), so
it still needs caching ....and let's not talk about the memory
leak (flood?) of the current code), what I am really wondering is
something else:
Let's assume performance is bad to draw the rects that need an
update. This somehow results into a very slow feeling of the
application when I use the window scroll bar. What I am wondering
is how to keep that still snappy and maybe just skip a few
updates. Because when I scroll the bar at a very high speed I
really only car about the final position of the bar. So how would
I get the drawing to be a bit more lazy. Only do the update when
the speed of the bar becomes slower. Does that require drawing to
happen in different thread?
My suggestion is not to think about ways round it like this just
now. Instead, look at your app in the various profiling tools,
figure out what's slow, and optimize it. You'll certainly get an
enormous gain by not loading the images from disk every time.
You'll probably get a decent gain by storing mipmaps of the images
and drawing an appropriately sized one. Finally, you'll probably
get a decent gain by thinking about how much you actually need to
draw when the view scrolls.
Sure - totally agree ...but I was wondering anyway. This was more a
hypothetical question how one would solve this if optimization was
just not enough. The badly written first-try code just brought up the
question.
cheers
--
Torsten
_______________________________________________
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