TableViewer terribly inefficient when loading a lot of data [message #660295] |
Thu, 17 March 2011 17:25 |
David Pérez Messages: 228 Registered: July 2009 |
Senior Member |
|
|
Hi,
I'm working a lot with TableViewer's in virtual mode (SWT.VIRTUAL style for the Table), and fetching only the visible items from the database (or other data sources).
It can potentially contain thoudsands of rows.
I have optimized so that data is fetched on the fly.
I think that none works in this way, because I've faced with a lot of bugs and inefficiencies, both in JFace and SWT. Am I right?
As an example of a bug, is that the AbstractTableViewer maintains in memory all the elements, in inner class VirtualManager.
On the other hand, Table class (at least under Win32), maintains in memory all the rendered TableItem's. This worses the memory problem.
I have solved all this inefficiencies.
I can contribute them, if desired, as a patch.
Now, I have discovered another one, that I have to solve right now:
AbstractTableViewer#setItemCount() forces to create all TableItem's.
In my test case, itemCount is 1,000,000 items and it takes many minutes to do so.
class AbstractTableViewer {
.....
public void setItemCount(int count) {
int oldCount = doGetItemCount();
if (count < oldCount) {
for (int i = count; i < oldCount; i++) {
Item item = doGetItem(i);
if (item.getData() != null) {
disassociate(item);
}
}
}
....
}
}
Does e4 improve a little this?
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.34629 seconds