[ 
https://issues.apache.org/jira/browse/MYFACES-3435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13193903#comment-13193903
 ] 

Leonardo Uribe commented on MYFACES-3435:
-----------------------------------------

After study this issue, the problem about extend from ArrayList is it force us 
to implement all methods, because we can't assume the parent is implemented in 
some specific way. Things are different for classes extending AbstractList, 
because the contract specify that it is just required to implementing some 
methods. 

I did a draft for _ComponentChildrenList but I would like to think this change 
more carefully. My first impression is sometimes performance improvements can 
ruin you code and make it difficult to read. Is it worth to do it? suggestions 
are welcome.
                
> [perf] _DeltaList: use ArrayList as parent
> ------------------------------------------
>
>                 Key: MYFACES-3435
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3435
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: General
>    Affects Versions: 2.0.12-SNAPSHOT, 2.1.6-SNAPSHOT
>            Reporter: Martin Kočí
>            Assignee: Martin Kočí
>            Priority: Minor
>         Attachments: MYFACES-3435.patch, _ComponentChildrenList2.java
>
>
> Two internal classes _DeltaList in API:
> 1) now use delegation pattern, but are always initialized with an ArrayList 
> instance -> use inheritance and  ArrayList as parent -> improvement in memory 
> area, reduces number of GCed object in one request/response of (_DeltaList 
> instances/2) 
> 2) initialize expected size of _DeltaList (for example, number of validators 
> per one component is perhaps never 10, use: new _DeltaList(5))
> 3) use indexes in 'for' instead of iterator (java.util.RandomAccess) ->  
> improvement in performance

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to