You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 12, 2022. It is now read-only.
Using a simple Grid with a large number of cells leads to extreme performance issues when setHeightByRow is true. Simple example:
@route("")
public class MainView extends VerticalLayout {
public MainView() {
List<List<String>> items = new ArrayList<>();
for (int i = 0; i < 5000; i++) {
items.add(Arrays.asList("A\n" + i, "B" + i, "C" + i));
}
Grid<List<String>> grid = new Grid<>();
grid.addColumn(item -> item.get(0)).setHeader("A");
grid.addColumn(item -> item.get(1)).setHeader("B");
grid.addColumn(item -> item.get(2)).setHeader("C");
grid.setDataProvider(DataProvider.ofCollection(items));
grid.setHeightByRows(true);
this.add(grid);
}
}
When increasing the number of cells the rendering time grows exponentially. It took up to 8 minutes in our real app, setting setHeightByRows to false brought us back to 5 seconds.
Chrome gives a hint: it seems that every new cell forces all existing cells to recalculate their size.