Vaadin 7 much slower than 6?

I’m evaluating to migrate my project from vaadin 6 to 7. I did some testing and it seems to me that version 7 is much slower.

Compare the performance of the following application version 6.8.8 and 7.0.5

VAADIN 6:

package com.example.vaadin6test;

import com.vaadin.Application;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;

public class Vaadin6testApplication extends Application {
	@Override
	public void init() {
		Window mainWindow = new Window("Vaadin6test Application");
		setMainWindow(mainWindow);
		
		TabSheet tb = new TabSheet();
		tb.addTab(generateComponents(), "Components 0");
		tb.addTab(generateComponents(), "Components 1");
		tb.addTab(generateComponents(), "Components 2");
		
		mainWindow.setContent(tb);
	}
	
	private VerticalLayout generateComponents() {
		VerticalLayout vl = new VerticalLayout();
		for(int i = 0; i < 100; i++) {
			TextField tf = new TextField("A text field");
			tf.setWidth("50px");
			vl.addComponent(tf);
		}
		for(int i = 0; i < 10; i++) {
			Table t = new Table();
			t.addContainerProperty("test0", String.class, null);
			t.addContainerProperty("test1", String.class, null);
			t.addContainerProperty("test2", String.class, null);
			t.addItem(new Object[]{"0", "1", "2"}, 0);
			t.setWidth("50px");
			t.setHeight("50px");
			vl.addComponent(t);
		}
		return vl;
	}

}

VAADIN 7:

package com.example.vaadin7test;

import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;

/**
 * Main UI class
 */
@SuppressWarnings("serial")
public class Vaadin7testUI extends UI {

	@Override
	protected void init(VaadinRequest request) {
		TabSheet tb = new TabSheet();
		tb.addTab(generateComponents(), "Components 0");
		tb.addTab(generateComponents(), "Components 1");
		tb.addTab(generateComponents(), "Components 2");
		setContent(tb);
	}
	
	private VerticalLayout generateComponents() {
		VerticalLayout vl = new VerticalLayout();
		for(int i = 0; i < 100; i++) {
			TextField tf = new TextField("A text field");
			tf.setWidth("50px");
			vl.addComponent(tf);
		}
		for(int i = 0; i < 10; i++) {
			Table t = new Table();
			t.addContainerProperty("test0", String.class, null);
			t.addContainerProperty("test1", String.class, null);
			t.addContainerProperty("test2", String.class, null);
			t.addItem(new Object[]{"0", "1", "2"}, 0);
			t.setWidth("50px");
			t.setHeight("50px");
			vl.addComponent(t);
		}
		return vl;
	}

}

Click on tab 2 and 3 and now move around, you’ll notice a tab now is loaded immediately in version 6 but takes time to load in version 7.
I can be more precise by posting a benchmark, but you can see with your eyes the difference.

I did the test with Chrome 26.0.1410.64 m.

There are also other threads about this with more information.

The short version: Vaadin 7 (communication and) rendering is slower than Vaadin 6 in some cases, faster in others. This is especially visible for the initial page rendering, which people tend to notice and possibly measure. Vaadin 7.0.0 was quite a bit slower but the latest Vaadin 7.0.x are already closer to Vaadin 6. For several kinds of updates Vaadin 7 can be faster than Vaadin 6, but few people notice when things go for the better.

Background: With Vaadin 6, we were running into a dead end where we could not improve layout etc. performance much anymore because one of the main bottlenecks was numerous browser internal context switches between JavaScript and rendering. Also, the complexity of layouts was overwhelming. In Vaadin 7, we managed to remove a lot of the context switches by restructuring code and moving more processing to the browser (which was not possible while still supporting IE6/7 in Vaadin 6), but the initial implementation was not as fast as we hoped. However, the current implementation can be optimized little by little, and we have been doing that and will continue doing so.

Thank you for your reply. I’ll check out the other threads.
I’m going to migrate my project anyway and wait for new releases with performance improvements.
Keep up the good work

I am struggling to have my application working in an acceptable way with vaadin 7 under IE 8.
adding / removing (or just setting visible) some parts of the layout is very slow (most of the time seems to be lost in javascript calls).
Looks like it is especially true when there are Table components (even if not with a lot of rows). There is a big regression from vaadin 6 here.

same IE8 issue here. Tables components are slow even with 1-2 rows.

Just checking if we perceive speed differently: how bad is the QuickTickets Dashboard demo:
http://demo.vaadin.com/dashboard/

For me, the app feels slow, yes, but still maintaining a responsive feel, so that the app doesn’t seem to “hang” (the Schedule view calendar is an exception, that takes a long time to render). How about you, is it above or below acceptable?

We also face serious issues with the table component in IE8. Beginning with 10 entries within a table the UI begins to be slow on layout operations. That is especially the case if you “jump back” to a screen containing a table with a few rows.

Today I tried out the IE8 JS profiler to figure out what causes this behavior. Everything pointed to the element.getBoundingClientRect() JS method, which takes 90% of the rendering time and called rather often. I created a ticket on that, hope it is somehow useful

http://dev.vaadin.com/ticket/12037

It is important to mention, that FF and Chrome have excellent performance on these screens.