[ Home | CW Bug Reports | Mail ]

LTableView描画速度低下
Subject: BUG -- LTableView design flaw which slows down drawing
 
---------------------------------------------------------------------------
METROWERKS PRODUCT AND USAGE SECTION
 
Product name :            [ CodeWarrior Professional ]
Product version :         [ Pro 4 ]
Component name :          [ PowerPlant ]
Generating:               [ Mac OS 68K / Mac OS PowerPC ]
Purpose:                  [ application ]
 
---------------------------------------------------------------------------
 
BUG DESCRIPTION SECTION
 
Reason for this report:   [ incomplete program feature ]
Bug severity:             [ extreme degradation of speed ]
Reproducibility:          [ always ]
Problem summary:
 
The LTableView class has a design flaw which slows down drawing
process considerably.
LTableView::DrawSelf() calls HiliteSelection() at the end of the
function. This eventually invokes the following code to deal with the
visible selection.
 
    while (GetNextSelectedCell(theCell)) {
        //        :
        //        :
        if (theCell >= botRightCell) {
            break;        // No need to go past last Cell
        }                 //   that's within the Frame
    }
 
This code seems reasonable with the conditional break statement, but
it is not.
 
LTableView::GetNextSelectedCell() does not return until the end of the
table if there is no selection. Hence the above code scans entire
table cells nearly always at the top position. This slows down drawing
and scrolling of the table terribly if the table has many cells.
 
I encountered terrible slow down with a table row:50000 * column:1.
But even a table row:100 * column:100 has 10000 times repetition at
worst.
 
I avoided this problem by overriding GetNextSelectedCell(). I guess
the better solution for LTableView class is to create the
GetNextSelectedCellInRange() method or to iterate visible cells simply
by CellIsSelected().


この Pageは MacOS X + Radio UserLand で作っています。