Navigation
My Stuff:
Other Sites
Search
Saturday
Jul142007

Any Amount of Computation is Worth It

There are very few specific instructions I can remember being given during my Computer Science course at University. However, one stands out and has stayed with me in the years since:

"Any amount of computation is worth it, to avoid having to draw to the screen."


It's not an exact quote, and my attribution to Dr. Peter Dickman might be nothing more than a hazy recollection, but it's still golden advice.

I've been working on some additions to Blake Seely's MUPhotoView class. In particular, I'm implementing support for drag-reordering the photos in the view. Since the view has to track the user's drag in order to draw the insertion point, it's a performance-critical operation. I don't know about you, dear reader, but I hate stuttery drags.

The difference between calling `[photoView setNeedsDisplay: YES]` and calling `[photoView setNeedsDisplay: myUnionOfDamagedRects]` is remarkable.

Reader Comments (1)

Here here! And I totally agree - never draw if you don't have to.

July 14, 2007 | Unregistered CommenterBlake Seely
Editor Permission Required
You must have editing permission for this entry in order to post comments.