«Back
Is your Vaadin application becoming sluggish?

(by Matti Tahvonen)

Yes, this can happen - it is no secret. This can happen for every application, with every programming language, with every UI library and with all hardware platforms. Make it a web application and it is not even hard. For end users this is not acceptable, especially when building applications for frequent use.

All developers have heard the phrase premature optimization is the root of all evil, coined by software guru Donald Knuth. There is a wisdom in that clause. Still I want to motivate you (Vaadin developer) to read this article, even if you currently have no performance issues. I'd say it is not that bad to know what will inevitably make your application slow. You might subconsciously avoid the worst pitfalls (but still not be subjected to premature optimization) and avoid optimization task totally.

Resolving performance issues in Vaadin-based applications may be a bit tricky in some situations. Performance issues are one of the most common issues why project managers in IT Mill come and disturb our "peace" in the RnD team. Usually we'll end up modifying the application, not Vaadin. Vaadin abstracts away the browser environment, and the abstraction may make it hard to figure out what is the actual cause for a slow UI.

The first step is to detect whether to optimize the server side or the client side. You can use all standard profiling tools with Vaadin apps like Firebug for the client side and JProfiler for the server side. For a quick look for what is taking so long it is easy to use "?debug" query parameter in application. It will show you a small floating console in the browser. Inspecting messages there, one can see server visit time (includes both network latency and server processing time) and the actual time spent handling the response in client.

If the problem is on server side, it is most commonly in the back-end system or how it is connected to Vaadin components. The server side code of Vaadin is pretty well optimized by the JVM. If the server side is your problem, I'd bet you will end up optimizing SQL queries. Optimizing tricks for server side are very similar to any other Java application.

If it is the client side processing that takes a long time, optimizing methods are more Vaadin specific. There are several tricks one can perform to optimize the client side processing time. Some of them are more or less generic to ajax applications in common, others are purely Vaadin specific. If you belong to the large group of Java developers who hate browser programming, you don't need to get worried at this point. Although the processing time is long on client, you will be mostly modifying the pure server side Java code when optimizing your application.

Read top optimization tips and tricks from Vaadin Wiki

 

Comments
Vaadin community is huge and growing. There is lots of stuff happening “behind the scenes” that don’t get enough attention among our average users. Thus we have decided to
Concurrency and distributed systems are probably among the hardest parts of software engineering. Basic Java EE apps usually don’t need to deal with these issues that much, but increasing
We're pleased to announce the public release of Tori – the modern and sleek discussion forum for Liferay portal . We've kept Tori under the blanket while developing it and
There is a point in every enterprise web application project when the scalability of the application under development is wanted to be measured. There are several reasons for why scalability tests
Vaadin TestBench is a browser automation tool, suited for creating UI level tests for Vaadin applications. It is based on Selenium 2, which means that all features of Selenium 2/WebDriver are also
Showing 1 - 5 of 100 results.
of 20

See all blog entries
Subscribe to this blog