You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Martin Kočí (JIRA)" <de...@myfaces.apache.org> on 2012/05/22 22:11:40 UTC

[jira] [Created] (MYFACES-3552) [perf] pps: reduce amout of Object [] created in _DeltaList.saveState

Martin Kočí created MYFACES-3552:
------------------------------------

             Summary: [perf] pps: reduce amout of Object [] created in _DeltaList.saveState
                 Key: MYFACES-3552
                 URL: https://issues.apache.org/jira/browse/MYFACES-3552
             Project: MyFaces Core
          Issue Type: Improvement
            Reporter: Martin Kočí
            Priority: Minor


consider a component with 5 listeners (or other attached objects). All listeners implement PartialStateHolder.
In a ideal case, delta is 0.

javax.faces.component._DeltaList.saveState(FacesContext) currently creates :
1) a Object [] array with length 5
2) a  _AttachedDeltaWrapper, one for each listener, 5 total

but in the end, when delta is 0, saveState returns null and all object are GCed immediately


--
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

       

[jira] [Commented] (MYFACES-3552) [perf] pps: reduce amout of Object [] created in _DeltaList.saveState

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-3552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13283514#comment-13283514 ] 

Leonardo Uribe commented on MYFACES-3552:
-----------------------------------------

The patch has a bug, it remove one line that sets nullDelta = false , which is used later to check if it should return null or not. I think it is better to let is as is, because the jvm is smart enough to quickly gc the instance created if it does not used, because it is discarded inside the same method. 
                
> [perf] pps: reduce amout of Object [] created in _DeltaList.saveState
> ---------------------------------------------------------------------
>
>                 Key: MYFACES-3552
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3552
>             Project: MyFaces Core
>          Issue Type: Improvement
>            Reporter: Martin Kočí
>            Priority: Minor
>         Attachments: MYFACES-3552-v1.patch
>
>
> consider a component with 5 listeners (or other attached objects). All listeners implement PartialStateHolder.
> In a ideal case, delta is 0.
> javax.faces.component._DeltaList.saveState(FacesContext) currently creates :
> 1) a Object [] array with length 5
> 2) a  _AttachedDeltaWrapper, one for each listener, 5 total
> but in the end, when delta is 0, saveState returns null and all object are GCed immediately

--
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

       

[jira] [Commented] (MYFACES-3552) [perf] pps: reduce amout of Object [] created in _DeltaList.saveState

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-3552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13283484#comment-13283484 ] 

Leonardo Uribe commented on MYFACES-3552:
-----------------------------------------

1) Yes, the impact will be minimal but it is ok. I didn't apply that change before, because I wanted to keep the algorithm as small as possible. No objections from my side.
2) that check is intentional. See MYFACES-2342, I let a note long time ago that says:

"... It was also found that _DeltaList count instances of Serializable or no StateHolder classes as if it could change the delta. According to the documentation, if a class (FacesListener) needs to handle state it must implements StateHolder/PartialStateHolder. Serializable or no StateHolder instances are consider inmutables. Note that UIOutput.converter takes that into account that. "

                
> [perf] pps: reduce amout of Object [] created in _DeltaList.saveState
> ---------------------------------------------------------------------
>
>                 Key: MYFACES-3552
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3552
>             Project: MyFaces Core
>          Issue Type: Improvement
>            Reporter: Martin Kočí
>            Priority: Minor
>         Attachments: MYFACES-3552-v1.patch
>
>
> consider a component with 5 listeners (or other attached objects). All listeners implement PartialStateHolder.
> In a ideal case, delta is 0.
> javax.faces.component._DeltaList.saveState(FacesContext) currently creates :
> 1) a Object [] array with length 5
> 2) a  _AttachedDeltaWrapper, one for each listener, 5 total
> but in the end, when delta is 0, saveState returns null and all object are GCed immediately

--
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