tags:

views:

56

answers:

2

When I create even a simple "hello world" application for Vaadin, deploy it to the server, and type application URL in the browser, I have to wait about 5-10 seconds for the application to appear. Next runs are fast, but when I redeploy or hot-swap classes, I have to wait again. When I add it to database startup time, server startup time, etc, it takes too long.

Is there any way to eliminate this slowness of Vaadin startup? It's important, because each extra slowness makes modify+run+test programming cycle more frustrating - not all code can be unit-tested, the only way to test some things is manual modify+run+test.

Similar problem exists with GWT debug mode. Because Vaadin is based on GWT, perhaps the reason of this slowness is not in Vaadin but in GWT?

My environment: IntelliJ 9 + Tomcat 6 + Windows 7 64-bit + fast Core 2 Duo

+1  A: 

The problem is caused by all the Java classes being loaded for the first time, subsequent calls can use the cached classes.

However 5-10 seconds is, imho, really not that bad, I've had much worse.

NimChimpsky
5-10 secs is in a small application with only about 30 Vaadin classes. I guess that it will be only slower when the codebase grows.
iirekm
A: 

If it is slow when the Vaadin application is restarted: Check that your Application.init() method is not making anything too heavy - database connections, loading lot of data etc. You can force this session restart in Vaadin with URL parameter ?restartApplication

If the hot deployment is slow even when the application is not restarted (UI state remains): This has something to do with the client-side (GWT) part of Vaadin. Might be that caching is somehow completely ignored. Widgetset opimization might help.

quickanalysis
In both cases restart is slow. It's slow even with simple 'hello world' applications, without any code in Application.init()
iirekm