Handling very large data with Nattable [message #1275332] |
Sat, 22 March 2014 19:03  |
Eclipse User |
|
|
|
Hello, i have a list of 30 000 entries (for example invoices), i've created a nattable with multiple layers (Group by, sort by, filtering). But when i try to load the 30 0000 entries, it's take more than 40 second. Can any one explain me the necessary step to load all this amount of entries faster ? or explain me the _900_Everything_but_the_kitchen_sink example to do the same think. Or is there a way to use pagination ?
[Updated on: Sat, 22 March 2014 19:14] by Moderator
|
|
|
|
|
Re: Handling very large data with Nattable [message #1275590 is a reply to message #1275522] |
Sun, 23 March 2014 05:21   |
Eclipse User |
|
|
|
I have two problems, loading data to the memory (hibernate) take 3 seconds and defining all the layers before instantiate the nattable take 4-5 seconds (where the body layer stack takes 2 seconds). For the nattable creation, i have an abstract class that contains all the common thinks to create a nattable, for each Business Object list (like invoices), i extend the abstract class where i define the bodylayer stack and columns mapping ....
I have observed that the first loaded Business object list with nattable take 4-5 seconds (where the body layer stack takes 2 seconds) for defining layers but when i loaded other businnes object list it takes <= 1 second with the same amount of data entries.
Here is the code where i define the body layer stack :
public BodyLayerStack(List<T> values,
IColumnPropertyAccessor<T> columnPropertyAccessor,
ConfigRegistry configRegistry) {
// wrapping of the list to show into GlazedLists
// see http://publicobject.com/glazedlists/ for further information
long startTime= System.currentTimeMillis();
this.eventList = GlazedLists.eventList(values);
TransformedList<T, T> rowObjectsGlazedList = GlazedLists
.threadSafeList(eventList);
// use the SortedList constructor with 'null' for the Comparator
// because the Comparator
// will be set by configuration
this.sortedList = new SortedList<T>(rowObjectsGlazedList, null);
// wrap the SortedList with the FilterList
this.filterList = new FilterList<T>(sortedList);
// Use the GroupByDataLayer instead of the default DataLayer
this.bodyDataLayer = new GroupByDataLayer<T>(getGroupByModel(),
filterList, columnPropertyAccessor, configRegistry);
// get the IDataProvider that was created by the GroupByDataLayer
this.bodyDataProvider = bodyDataLayer.getDataProvider();
// layer for event handling of GlazedLists and PropertyChanges
GlazedListsEventLayer<T> glazedListsEventLayer = new GlazedListsEventLayer<T>(
bodyDataLayer, filterList);
ColumnReorderLayer columnReorderLayer = new ColumnReorderLayer(
glazedListsEventLayer);
ColumnHideShowLayer columnHideShowLayer = new ColumnHideShowLayer(
columnReorderLayer);
this.selectionLayer = new SelectionLayer(columnHideShowLayer);
// add a tree layer to visualise the grouping
TreeLayer treeLayer = new TreeLayer(selectionLayer,
bodyDataLayer.getTreeRowModel());
ViewportLayer viewportLayer = new ViewportLayer(treeLayer);
setUnderlyingLayer(viewportLayer);
long stop= System.currentTimeMillis();
System.out.println("Body layer stack take : "+(stop-startTime)/1000+" seconds");
}
|
|
|
|
|
Re: Handling very large data with Nattable [message #1276465 is a reply to message #1276417] |
Mon, 24 March 2014 11:46  |
Eclipse User |
|
|
|
On my machine createExampleControl takes about 1700ms. I have an Intel i7 2.7 GHz with 8GB RAM, OS is Windows 7 64bit.
I'm not sure what's the issue in your environment, but I don't think it's NatTable related. Otherwise the main purpose of NatTable would be broken and all of the NatTable users would stop using it, as it doesn't do what it is intended to do.
|
|
|
Powered by
FUDForum. Page generated in 0.15040 seconds