Polling do unnecessary layouting #4668

Closed
vaadin-bot opened this Issue Nov 11, 2013 · 6 comments

Comments

Projects
None yet
1 participant
Collaborator

vaadin-bot commented Nov 11, 2013

Originally by cesnek


Polling do layouting every time. Even if no change is made to the server.

-This is big problem when polling interval is set to small amount of time and client side layouting takes long time.*

https://vaadin.com/cs/wiki/-/wiki/Main/Using%20polling

	@Override
	protected void init(VaadinRequest request) {

	    //Start polling
	    setPollInterval(1000);

	    //create enough complex layout
	    HorizontalLayout layout = new HorizontalLayout();

	    for(int i=0 ; i<1000 ; i++) {
		    VerticalLayout verticalLayout = new VerticalLayout();
		    verticalLayout.addComponent(new Label("Label"));
		    verticalLayout.addComponent(new TextField("caption 2"));
		    verticalLayout.addComponent(new DateField("caption 3"));
		    layout.addComponent(verticalLayout);
	    }

	    setContent(layout);

	    //TEST
	    //do nothing in background (or very rarely)
	    //new Thread(new Loader()).start();
	}

-*Client debug window:**[[BR]]
Received message: for(;;);[{"changes" : [], "state":{}, "types":{}, "hierarchy":{}, "rpc" : [], "meta" : {}, "resources" : {}, "timings":[12529, 5]}][[BR]]
JSON parsing took 1ms[[BR]]
handleUIDLMessage: 185 ms[[BR]]
Total layout phase time: 648ms <- This is the issue[[BR]]
Processing time was 847ms for 121 characters of JSON[[BR]]


Imported from https://dev.vaadin.com/ issue #12936

Collaborator

vaadin-bot commented Nov 11, 2013

Originally by cesnek


Right now only available solution for fast polling is use PUSH.[[BR]]
But PUSH caused us many other difficulties.

Collaborator

vaadin-bot commented Nov 12, 2013

Originally by @Artur-


Polling is a special case. The real problem is that everything is measured whenever there is a message from the server.

Collaborator

vaadin-bot commented Nov 12, 2013

Originally by @Legioth


Will do this for Vaadin 7.2 since it depends on #12180 and has the risk of causing some subtle regressions that we'd rather have more time to catch.

vaadin-bot closed this Nov 25, 2014

Collaborator

vaadin-bot commented Nov 25, 2014

Originally by CodingFabian


Leif, can you give us some background how this is fixed in 7.4? I cannot find how this was changed.

Collaborator

vaadin-bot commented Nov 25, 2014

Originally by @Legioth


This is the change that, as a side effect, fixes this issue: https://dev.vaadin.com/review/#/c/3915/

Collaborator

vaadin-bot commented Nov 25, 2014

Originally by CodingFabian


Thanks!

vaadin-bot added the bug label Dec 10, 2016

vaadin-bot added this to the Vaadin 7.4.0.beta1 milestone Dec 10, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment