Project

General

Profile

Feature #4041

[Performance] Defer widget server-client state synchronization

Added by Hynek Cihlar about 5 years ago. Updated about 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
version_reported:
version_resolved:

History

#1 Updated by Hynek Cihlar about 5 years ago

Currently widget state is pushed to the client eagerly, with every widget attribute assignment or method call changing the widget state. This introduces high number of round trips from the server to the client and associated processing (for example layout calculation) especially during the times when screens are being created and initialized by legacy code. This number of round trips could be reduced by deferring the state synchronization calls until later when the new state is really needed. We partially do this, for frame setup where state is pushed to the client only after frame setup "block" is finished. But this is limited only to the frame creation, any state changes outside of this limited scope are pushed eagerly one by one.

The idea is to mark a dirty state in a widget when an attribute is assigned and only push the state to client when the widget state is accessed (by reading a widget attribute for example) or when the control is handed back to the user for input before widgets are drawn.

The state synchronization on access is a bit tricky as there may be inter widget dependencies. For example changing widget size attributes can affect layout of the widget frame. But even having a safe rule that would cause the state push on any access of the whole widget tree could bring a significant reduction of client round trips I believe.

Also available in: Atom PDF