myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Myfaces Wiki] Update of "GSoC2010_StateSavingPerformanceImprovements" by Marius Petoi
Date Wed, 07 Apr 2010 13:37:17 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The "GSoC2010_StateSavingPerformanceImprovements" page has been changed by Marius Petoi.
http://wiki.apache.org/myfaces/GSoC2010_StateSavingPerformanceImprovements?action=diff&rev1=16&rev2=17

--------------------------------------------------

  
  On the other hand, all component classes implement the interface Partial''''''State''''''Holder,
which extends State''''''Holder. State''''''Holder is an interface which contains methods
for saving and loading state. Its extension, Partial''''''State''''''Holder contains three
extra methods: clear''''''Initial''''''State, initial''''''State''''''Marked and mark''''''Initial''''''State,
which help to the implementation of partial state saving. All components that have a partial
saving of their state implement this interface. The difference between full state and partial
state is made using two wrapper marker classes: _Attached''''''State''''''Wrapper and _Attached''''''Delta''''''Wrapper.
  
- In the Application object, a State''''''Manager is held. The actual state manager used at
the moment is Jsp''''''State''''''Manager''''''Impl. In the restore view phase of the JSF
lifecycle, the "restoreView"  method of the State''''''Manager is invoked. This retrieves
the State''''''Management''''''Strategy, which traverses the component tree and for each of
the components restores its state(this means that the "restoreState" metod of the component
is invoked). Also the tree of components is updated by taking into account the added and removed
components. Upon saving, the added and removed components are saved, as well as the difference
in state for each of the components. For each of the components, the "save''''''State" method.
+ In the Application object, a State''''''Manager is held. The actual state manager used at
the moment is Jsp''''''State''''''Manager''''''Impl. In the restore view phase of the JSF
lifecycle, the "restoreView"  method of the State''''''Manager is invoked. This retrieves
the State''''''Management''''''Strategy, which traverses the component tree and for each of
the components restores its state(this means that the "restoreState" metod of the component
is invoked). Also the tree of components is updated by taking into account the added and removed
components. Upon saving, the added and removed components are saved, as well as the difference
in state for each of the components. For each of the components, the "save''''''State" method
is invoked.
+ 
+ In the base class for all components, UI''''''Component''''''Base, the method "restore''''''State"
builds the component based either on the full state or based on the old state and the saved
"delta". The difference between the two is made by using the two different wrappers for states:
 _Attached''''''State''''''Wrapper and _Attached''''''Delta''''''Wrapper. In addition to these,
there is another wrapper class for lists: _Delta''''''List, which adds to the normal list
partial saving and restoring functionalities. Upon restore state, for lists, the elements
that do not exist are added, while the state for the existing ones is updated.
+ 
+ The state in UI''''''Component''''''Base is: faces listeners, behaviors map and system event
listener class map. In addition to these, there is the State''''''Helper, which was initially
designed to hold properties which are not components (for example properties which have only
a String value, for which there is no "delta"). The implementing class used for partial state
saving is _Delta''''''State''''''Helper, which for a certain component stores the initial
value and the deltas, which represent the values of the properties at some stages for some
properties retrieved with a key. 
+ 
+ However, there are some properties which are components and which are saved in the State''''''Helper.
For objects saved in the State''''''Helper, partial state saving is not used, as the entire
object is saved at each stage
  
  This project is intended to take a deeper look into what exactly is saved at the moment.
The saved state should be analyzed and see whether anything can be skipped. For this, memory
profiling should be done and see which part of the saved state occupies the most memory. Afterwards,
we should see how much of this is really used and what can be dismissed.
  

Mime
View raw message