Reputation:
We are developing a tool using vaadin 6.8. If we use it with local server there is no issues in time taken to load. But if i connect it to live server there is huge difference in time . Even it takes large time to switch between two tabs in the tool. Any help could be advisable?
Thanks, Vicky
Upvotes: 0
Views: 788
Reputation: 2703
I got the same issue once with Vaadin 6 where i got whole application loaded using main application constructor when user logged in to the welcome screen of the application. my solution was stop constructing all the tabs within the application contractor it self, and only loading/constructing the other tabs on click of each tab. so the application memory footprint and the loading time gets smaller, and application loads the screens only when a user needed to view the screen.but this applies only to a Vaadin application which is having a lot of Tabs/screens and components.
welcome.addListener(new TabSheet.SelectedTabChangeListener() {
public void selectedTabChange(SelectedTabChangeEvent event) {
// build tab here on event
also, note that one disadvantage of using Vaading for application development is that it increase network traffic which will be a key factor when on a external/live server, so keep in mind that point when you add lots of events to fire on components.
also, better check how many components are getting loaded on the trigger of the event as well, plus also better check coding other then the UI, as in case of a back-end method slowness might be getting effected to the loading of the UI, like for example, missing a db index when uploading to the live server, also add lines to take the loading time out of your UI load methods as in,
long starttime = System.currentTimeMillis();
// then your code lines of the application or tab build
....
// get the execution time from start to end
System.out.println("took time-->" + System.currentTimeMillis() - starttime );
so you can get an idea of the loading/processing time of the method. if the loading time is significantly high, most probably it might not be the UI that is getting slow down.
Upvotes: 1