carl 74 posts since
Oct 17, 2007
13.
Re: Profiling 3.0 applet Oct 8, 2008 12:38 AM

in response to:
tiju
But still, 3000 x 90 objects (as per my earlier code above) will be created and held in memory, right?
No, those are precisely the problems that RecordGrid is designed to solve for you.
The existing RecordGridUIs all create only (about) as many cells as are visible in the grid, at least in the vertical dimension. When "scrolled", instead of new cells being created or cached cell brought into view, the existing cells are left in place and their contents refreshed. See
RecordGridCell.refresh-data . So if you have an existing case that uses static Frames, the major change will be to make some sort of
RecordGridCell that's mutable. And creating a
RecordSet with the base data.
In your example, if you have a RecordGrid 20 rows high, then you'd have 20 by 90 cells in existence. Initially, those would be displaying the first 20 Records. If you scrolled to the last row, each cell would be notified that it was now displaying a new row -- for example, the last visible row would be driven by the data in the last Record -- then told that it should refresh its contents to show those new values. You'd still have 3000 by 90 pieces of data in memory (unless you have custom
RecordGridColumn s that manage to use less) but not the overhead of keeping visual representations for each at all times.