vaadin/flow-and-components-documentation

Document that using many columns with ComponentRenderer leads to horrible Grid performance

Opened this issue · 1 comments

If a Grid has 9 columns and roughly 30 rows and every column uses ComponentRenderer, that means on every scroll, 270 new components are sent to the client-side (with possible child components, multiplying the component count) while 270 another components are being detached. In fact if a page size of 100 is used, around 800 components are sent to the client-side grid, each of the component with a lots of state and potential children. This could cause 2 MB worth of JSON to be sent from VaadinServlet to the client-side; just parsing that mammoth JSON will take a couple of seconds on the client-side.

The Grid then starts exhibiting random visual failures (cells not populated, shadow scroll bar appearing when scrolling, browser freezes, huge JSONs sent from the server-side). It's very hard to link these failures to heavy usage of ComponentRenderers. The documentation should clearly
document a clear warning regarding heavy usage of CompoentRenderers and list these failures so that the programmer is warned upfront.

The cells-not-populated issue: vaadin/vaadin-grid-flow#937

The possible solution: https://github.com/vaadin/vaadin-grid-flow/issues/765