You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org> on 2011/05/06 18:32:03 UTC
[jira] [Updated] (MYFACES-3111) [PERF] Review
UIData.saveDescendantComponentStates and restoreDescendantComponentStates
[ https://issues.apache.org/jira/browse/MYFACES-3111?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Leonardo Uribe updated MYFACES-3111:
------------------------------------
Resolution: Fixed
Fix Version/s: 2.1.0
2.0.6
Assignee: Leonardo Uribe
Status: Resolved (was: Patch Available)
I have checked and the patch is ok. Yes, it is true there is still a lot of room from improvement. I'll keep that in mind.
> [PERF] Review UIData.saveDescendantComponentStates and restoreDescendantComponentStates
> ---------------------------------------------------------------------------------------
>
> Key: MYFACES-3111
> URL: https://issues.apache.org/jira/browse/MYFACES-3111
> Project: MyFaces Core
> Issue Type: Improvement
> Components: General
> Affects Versions: 2.0.6-SNAPSHOT
> Environment: myfaces core trunk
> Reporter: Martin Kočí
> Assignee: Leonardo Uribe
> Fix For: 2.0.6, 2.1.0
>
> Attachments: MYFACES-3111.patch
>
>
> 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.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira