On 19-Oct-09, at 10:40 PM, Andy Lee wrote:

Come to think of it, another experiment would have been to add logging to the cells used for the other table columns, to see if their drawing code was actually being called.

Yeah, I did that. See my previous post. The upshot is that the table is correctly doing minimal redraws.

Sorry if I missed this, but is the string-drawing overhead noticeable to the user? If so, and it's because you're redrawing very frequently, maybe you could throttle redrawing to, say, 2-4 times per second. There's something called coalesced updates that might help.

I'll check it out. I kinda want it to redraw a lot really really fast, though, because it looks cool. ;-> I'm throttling my drawing to 60 frames per second at present, and then I'm trying to optimize the drawing code so that it takes as little time as possible, so that as much of each 1/60th second is left to calculate in as possible. Maybe I will make the tableView update every 1/30th of a second, and update everything else every 60th since it all draws faster. :->

Does the table column's cell have to do much work to get the string it needs to draw (a gross example would be querying a database)? Maybe caching would help.

  Nope, all the time is in the string-drawing stuff inside AppKit.

I don't know how much overhead is in cell drawing, but maybe you could write your own cell class that doesn't, for example, check whether the string needs to be truncated.

IIRC it wasn't stuff like that. It was setting up the text storage and the typesetter, and then doing the actual drawing, I think. Nothing I could reasonably optimize, I think, without getting extremely dirty.

There's a section in the docs on optimizing drawing. I must admit I haven't read it, but maybe it contains something that would help in your case?

Read that. Useful tips, and it did prompt me to put in checks for whether parts of my views are inside the dirty rects or not, and to make more of my views opaque.

Sorry for all the might's and maybe's --I'm hoping one of my stabs in the dark will help.

Well, I'm curious about the coalesced update thing. The only ref I find through Google is here:

http://developer.apple.com/mac/library/documentation/Performance/Conceptual/Drawing/Articles/CocoaDrawingTips.html

and I don't think that's what you're referring to. AppKiDo (which I still love :->) doesn't find any APIs with "coalesce" in their name that are drawing-related. Can you give me a pointer?

  Thanks!

Ben Haller
Stick Software


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to