getFacetsAndChildren from UIXComponentBase allocates a lot of memory
--------------------------------------------------------------------

                 Key: TRINIDAD-1164
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1164
             Project: MyFaces Trinidad
          Issue Type: Bug
    Affects Versions:  1.2.8-core
            Reporter: Stevan Malesevic


getFacetsAndChildren of UIXComponentBase is invoked number of times during 
request processing (_findInsideOf , decode,....). In the case where component 
has facets the code will rebuild a ArrayList on every invocation. This is very 
expensive in terms of total allocated transient memory and CPU. We should save 
the ArrayList of facets and children first time it is built and recreate only 
in case of change. 
Also,  the call _facets.values() which creates iterator seems very expensive. 
Maybe better approach is to just do:

    for(int i = 0; i < _facets.size(); i++) 
    {
        childrenAndFacets.add(((FacetHashMap)_facets).getValue(i));
    }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to