Return-Path: X-Original-To: apmail-myfaces-dev-archive@www.apache.org Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 23C0B9583 for ; Tue, 6 Mar 2012 17:19:25 +0000 (UTC) Received: (qmail 71958 invoked by uid 500); 6 Mar 2012 17:19:24 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 71907 invoked by uid 500); 6 Mar 2012 17:19:24 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 71893 invoked by uid 99); 6 Mar 2012 17:19:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Mar 2012 17:19:24 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Mar 2012 17:19:18 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 4786DB509 for ; Tue, 6 Mar 2012 17:18:58 +0000 (UTC) Date: Tue, 6 Mar 2012 17:18:58 +0000 (UTC) From: "Leonardo Uribe (Commented) (JIRA)" To: dev@myfaces.apache.org Message-ID: <2043172065.28185.1331054338294.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <625038413.54310.1325270910656.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (MYFACES-3435) [perf] _DeltaList: use ArrayList as parent MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/MYFACES-3435?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D13= 223439#comment-13223439 ]=20 Leonardo Uribe commented on MYFACES-3435: ----------------------------------------- I have checked again the patch and I founded some inconsistencies in FacetH= ashMap that were fixed in _ComponentFacetMap some time ago (implement fully= Set interface for entrySet(), keySet() and valuesSet() ). Here is when del= egation pattern shines. It is possible to use ArrayMap instead HashMap and = improve performance in one step. If we use inheritance, I don't want to ima= gine the work required to fix this. I'm still thinking we can do other improvements (adjust structures sizes, c= ache some variables in some parts, ... ) and get bigger improvements withou= t sacrify the code structure. In other words, there are other parts of the = code that generate a lot more objects that this place.=20 Anyway, I splitted the patch in two and I applied it partially, adjusting t= he structure's size and replacing HashMap with ArrayMap for facets. The oth= er part of the patch (MYFACES-3435-7.patch) was attached here if in the fut= ure we came back to this point again. I'll let this issue open, but for now= that's all I'm going to do for the next release cycle. =20 > [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=C4=8D=C3=AD > Assignee: Martin Ko=C4=8D=C3=AD > Priority: Minor > Attachments: MYFACES-3435-2.patch, MYFACES-3435-7.patch, MYFACES-= 3435.patch, _ComponentChildrenList2.java > > > Two internal classes _DeltaList in API: > 1) now use delegation pattern, but are always initialized with an ArrayLi= st instance -> use inheritance and ArrayList as parent -> improvement in m= emory area, reduces number of GCed object in one request/response of (_Delt= aList instances/2)=20 > 2) initialize expected size of _DeltaList (for example, number of validat= ors 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 administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira