Details
Description
In my test case, method UIData.saveDescendantComponentStates allocates ~ 310 000 instances during one request/response. Most of them are empty List (+ Object []) and AbstractList$Itr
Problems:
1) The current code reminds me the old state saving style from JSF 1.X - a big table of (mostly empty) arrays.
2) Using getChildren().iterator() creates new instance of AbstractList$Iter.
3) Saving state of transient and state saving of EditableValueHolder: I don't see any mention of transient in setRowIndex JavaDoc.
Suggestions:
ad 1) JSF 2.0 and StateHelper is Map-based. Use map here or even the StateHelper directly. Create EditableValueHolderState instances only and not empty arrays and List. The saved state for a row with non-EditableValueHolder children must be null and must not allocate any objects.
ad 2) Use the old fashion way with indices; that will avoid thousand of unnecessary iterators instances.
ad 3) It seems that mojarra saves per-row state for every EVH, even for transients.