Vaadin 7 component lazy loading for performance im

2019-09-11 12:35发布

问题:

In my Vaadin 7 application I have a heavy view. Server side works pretty fast - all logic in my init() method takes ~100-150ms but rendering in the browsers takes a lot of time(depends on number of components). Right now it is ~10sec in order to display this view in Google Chrome.

I'm looking for a way in order to optimize performance of this view. I found LazyLoadWrapper but it looks a little bit outdated.

Is any similar to this component for Vaadin 7.6 in order to improve user experience and performance of view rendering ?

UPDATED

This is a demo project Vaadin Demo Project that can reproduce this performance issue.

In order to start this application please simple run Maven command:

mvn clean install 

from project folder in order to compile the source and Vaadin theme.

and then run com.techbook.ui.Application class (this class contains main method) and the application will be started on Embedded Tomcat 8 and then please access a following url:

http://127.0.0.1:8080/vaadin-ui/#!decisions/123/Name

com.techbook.ui.view.decision.DecisionView - is a view with a mentioned performance issue.

回答1:

I would suggest you to use Custom Layouts for this "heavy view", probably in combination with a simple htlm template. Another possibility that the application becomes faster is to replace certain layout combinations. E.g. Instead of a VerticalLayout and HorizontalLayout combination use a GridLayout. Use the AutoCompleteTextField or SuggestField addon instead of a NativeSelect or ComboBox if the UI guideline allows that.

I hope some of my suggestions may help you,

Florian