Handling very large data with Nattable [message #1275332] |
Sat, 22 March 2014 23:03 |
Mohamed SADI Messages: 38 Registered: December 2013 |
Member |
|
|
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 23:14] Report message to a moderator
|
|
|
|
|
Re: Handling very large data with Nattable [message #1275590 is a reply to message #1275522] |
Sun, 23 March 2014 09:21 |
Mohamed SADI Messages: 38 Registered: December 2013 |
Member |
|
|
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");
}
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01597 seconds