-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UIData performance and state saving improvements, results of some profiling sessions #2969
Comments
@javaserverfaces Commented |
@javaserverfaces Commented |
@javaserverfaces Commented |
@javaserverfaces Commented |
@javaserverfaces Commented |
@javaserverfaces Commented |
@javaserverfaces Commented |
@javaserverfaces Commented |
@javaserverfaces Commented |
@javaserverfaces Commented |
@javaserverfaces Commented |
@javaserverfaces Commented |
@javaserverfaces Commented svn commit -m "Fixes https://java.net/jira/browse/JAVASERVERFACES-2965, r=mriem, reduce table state" Thanks Hanspeter! |
@javaserverfaces Commented
|
@javaserverfaces Commented It looks like the above example seems to fail in finding the component. I am not entirely sure Thanks! |
@javaserverfaces Commented I see where the problem lies. Unfortunately I do not have time today to work on this, so unfortunately there is no other chance then to revert this change for the current release and I need to do some rework. Regards |
@javaserverfaces Commented Maybe we should separate the performance aspects into a separate issue so we can deliver the state size reduction already. regards |
@javaserverfaces Commented |
@javaserverfaces Commented svn commit -m "Fixes https://java.net/jira/browse/JAVASERVERFACES-2965, r=mriem, reverting performance changes, but keep state saving changes." |
@javaserverfaces Commented |
@javaserverfaces Commented |
|
reduce table state
SavedState instances saved with default state
UIData.saveDescentantState() creates and keeps SavedState instances for each EditableValueHolder/UIForm per row, even if the final SavedState instance has the same values as the default initial values for the saved attributes. For a small table with 10 rows and 5 columns with h:inputText this results in about 10KB state.
Change: SavedState instances will only be kept on state if the EditableValueHolder/UIForm state differs from the init values of SavedState. With that change if all the h:inputText are valid no single SavedState instance ends up in state. Only if input validation fails the SavedState instances hold delta state and must be stored in state.
restoreDescendentState() must handle non-saved SavedState by calling resetValue() on EditableValueHolder. On UIForm setSubmitted(false) is enough since that attribute is transient.
UIInput/UIOutput resetValue() does not clear state
See JAVASERVERFACES_SPEC_PUBLIC-1211, standard saveState also processes all column component for rowIndex -1. If UIData.restoreDescendentState() calls UIInput.resetValue() and this would remove delta state or the 3 attributes value, valid and localValueSet instead of calling the set methods to set deltaState to the same values as the default values would be.
UIData performance improvement
When rowIndex is set, UIData saveDescendentState()/restoreDescendentState() walk the whole children and facets sub-trees of all rendered UIColumns (including header/footer facets of UIColumns) to find all EditableValueHolder and UIForm to save SavedState instances for the current row and restore the values for the new rowIndex.
Change: walk the UIColumn sub-tree's only once to collect the components to process for SavedState handling and those to simply reset the id on restore. Not all component id's must be reset, only the ones of ActionSources, NamingContainers and components with explicitly set id's. Processing these preparedLists is 3-4 times faster then walking the sub-trees for save/restore.
The attached changebundle.txt contains the collected changes.
Also attached is a PDF with memory profiling details (inputText-in-table-saves-default-state.pdf).
Additional attached is the small test application that was used for profiling (saved-state.zip)
A fourth attachment will follow with performance comparision details.
Best regards
Hanspeter
Affected Versions
[2.2.1]
The text was updated successfully, but these errors were encountered: