Re: NSMatrix and NSCell redraw performance
Re: NSMatrix and NSCell redraw performance
- Subject: Re: NSMatrix and NSCell redraw performance
- From: John Hörnkvist <email@hidden>
- Date: Tue, 15 Jan 2002 15:19:25 +0100
On tisdag, januari 15, 2002, at 01:52 , Stephan R. Cleaves wrote:
Hi,
I have custom NSMatrix and custom NSCell subclasses. The NSCell
subclass does its own very minimal drawing, its really just a solid
fill color and some text being rendered. The instance of my NSMatrix
subclass is contained within an NSScrollView. I am getting quite bad
performance on redrawing. For starters if a group of cells are drawn
with their alternate background (still just a solid color) and I want
to change the group back to its default background and select a
different group to be drawn in its alternate background the operation
appears to take up to 1 to 2 seconds. Admittedly sometimes its faster,
but I'm more interested in getting it to be instantaneous all the time.
When I first started I had been computing the range of cells at the
time I wanted the redraw to occur, thinking this was causing my
slowness problem I modified the code to pre-compute the ranges, there
was effectively no improvement in speed. I had been telling the
NSMatrix instance that it needed to be displayed, and so I went after
that next and began to tell the individual cells to draw themselves.
This seemed to yield some improvement in performance, but its still too
slow. Now I'm wondering if the NSScrollView is more to blame. Any
suggestions people have for improving the performance of this would be
greatly appreciated.
How about providing some data?
Profile with gprof, or use sample or the Sampler application. That will
provide a lot more information to base any advice on. You may also want
to run QuartzDebug to catch multiple redraws.
Regards,
John Hornkvist
--
ToastedMarshmallow, the perfect Cocoa companion
http://www.toastedmarshmallow.com