NSMatrix and NSCell redraw performance
NSMatrix and NSCell redraw performance
- Subject: NSMatrix and NSCell redraw performance
- From: "Stephan R. Cleaves" <email@hidden>
- Date: Tue, 15 Jan 2002 07:52:32 -0500
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.
stephan