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 (Created) (JIRA)" <de...@myfaces.apache.org> on 2012/03/05 20:39:57 UTC

[jira] [Created] (MYFACES-3488) [perf] store facelets MARK_CREATED and rendererType at UIComponentBase level

[perf] store facelets MARK_CREATED and rendererType at UIComponentBase level
----------------------------------------------------------------------------

                 Key: MYFACES-3488
                 URL: https://issues.apache.org/jira/browse/MYFACES-3488
             Project: MyFaces Core
          Issue Type: Improvement
          Components: JSR-314
            Reporter: Leonardo Uribe
            Assignee: Leonardo Uribe


Inspired on the suggestions done in MYFACES-3470 and MYFACES-3471, I have found a solution for both cases.

MARK_CREATED and rendererType are special properties. Both are more related to the real UIComponent instance, which means those properties does not change for components inside a table (h:dataTable rowStatePreserved="true"). 

In the case of MARK_CREATED, almost all components created by facelets uses it, and this is assigned when the view is built. It has only sense to save this value when the component needs to be restored fully, but since this is a property that does not change once created, it does not have sense to store it on the delta. 

In the case of rendererType, the same as MARK_CREATED happens, but by the spec, it could be valid to set a ValueExpression for it and it is feasible to create a component, call markInitialState() and then call setRendererType(...), so this value could be saved on the delta.

Components that are created without properties (for example h:panelGroup) only require these two properties, so storing these values at UIComponentBase it is possible to prevent create unnecessary Map.Entry instances. 

--
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-3488) [perf] store facelets MARK_CREATED and rendererType at UIComponentBase level

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

Mark Struberg commented on MYFACES-3488:
----------------------------------------

intern can have mem disadvantages.
                
> [perf] store facelets MARK_CREATED and rendererType at UIComponentBase level
> ----------------------------------------------------------------------------
>
>                 Key: MYFACES-3488
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3488
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: JSR-314
>            Reporter: Leonardo Uribe
>            Assignee: Leonardo Uribe
>             Fix For: 2.0.13, 2.1.7
>
>
> Inspired on the suggestions done in MYFACES-3470 and MYFACES-3471, I have found a solution for both cases.
> MARK_CREATED and rendererType are special properties. Both are more related to the real UIComponent instance, which means those properties does not change for components inside a table (h:dataTable rowStatePreserved="true"). 
> In the case of MARK_CREATED, almost all components created by facelets uses it, and this is assigned when the view is built. It has only sense to save this value when the component needs to be restored fully, but since this is a property that does not change once created, it does not have sense to store it on the delta. 
> In the case of rendererType, the same as MARK_CREATED happens, but by the spec, it could be valid to set a ValueExpression for it and it is feasible to create a component, call markInitialState() and then call setRendererType(...), so this value could be saved on the delta.
> Components that are created without properties (for example h:panelGroup) only require these two properties, so storing these values at UIComponentBase it is possible to prevent create unnecessary Map.Entry instances. 

--
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] [Resolved] (MYFACES-3488) [perf] store facelets MARK_CREATED and rendererType at UIComponentBase level

Posted by "Leonardo Uribe (Resolved) (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-3488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe resolved MYFACES-3488.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.7
                   2.0.13
    
> [perf] store facelets MARK_CREATED and rendererType at UIComponentBase level
> ----------------------------------------------------------------------------
>
>                 Key: MYFACES-3488
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3488
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: JSR-314
>            Reporter: Leonardo Uribe
>            Assignee: Leonardo Uribe
>             Fix For: 2.0.13, 2.1.7
>
>
> Inspired on the suggestions done in MYFACES-3470 and MYFACES-3471, I have found a solution for both cases.
> MARK_CREATED and rendererType are special properties. Both are more related to the real UIComponent instance, which means those properties does not change for components inside a table (h:dataTable rowStatePreserved="true"). 
> In the case of MARK_CREATED, almost all components created by facelets uses it, and this is assigned when the view is built. It has only sense to save this value when the component needs to be restored fully, but since this is a property that does not change once created, it does not have sense to store it on the delta. 
> In the case of rendererType, the same as MARK_CREATED happens, but by the spec, it could be valid to set a ValueExpression for it and it is feasible to create a component, call markInitialState() and then call setRendererType(...), so this value could be saved on the delta.
> Components that are created without properties (for example h:panelGroup) only require these two properties, so storing these values at UIComponentBase it is possible to prevent create unnecessary Map.Entry instances. 

--
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-3488) [perf] store facelets MARK_CREATED and rendererType at UIComponentBase level

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

Leonardo Uribe commented on MYFACES-3488:
-----------------------------------------

The idea with that check lenght first is prevent an unnecessary cast. The number comparison is cheaper compared with the cast, so it is ok to let it as is.
                
> [perf] store facelets MARK_CREATED and rendererType at UIComponentBase level
> ----------------------------------------------------------------------------
>
>                 Key: MYFACES-3488
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3488
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: JSR-314
>            Reporter: Leonardo Uribe
>            Assignee: Leonardo Uribe
>             Fix For: 2.0.13, 2.1.7
>
>
> Inspired on the suggestions done in MYFACES-3470 and MYFACES-3471, I have found a solution for both cases.
> MARK_CREATED and rendererType are special properties. Both are more related to the real UIComponent instance, which means those properties does not change for components inside a table (h:dataTable rowStatePreserved="true"). 
> In the case of MARK_CREATED, almost all components created by facelets uses it, and this is assigned when the view is built. It has only sense to save this value when the component needs to be restored fully, but since this is a property that does not change once created, it does not have sense to store it on the delta. 
> In the case of rendererType, the same as MARK_CREATED happens, but by the spec, it could be valid to set a ValueExpression for it and it is feasible to create a component, call markInitialState() and then call setRendererType(...), so this value could be saved on the delta.
> Components that are created without properties (for example h:panelGroup) only require these two properties, so storing these values at UIComponentBase it is possible to prevent create unnecessary Map.Entry instances. 

--
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-3488) [perf] store facelets MARK_CREATED and rendererType at UIComponentBase level

Posted by "Martin Kočí (Commented JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-3488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13222614#comment-13222614 ] 

Martin Kočí commented on MYFACES-3488:
--------------------------------------

Good solution!

Only one question: 
if (MARK_CREATED.length() == ((String)key).length() &&
            MARK_CREATED.equals(key))
        {

I think String does this length == as first operations in equals():
String.equals:
....
	if (anObject instanceof String) {
	    String anotherString = (String)anObject;
	    int n = count;
	    if (n == anotherString.count) {

Or can we use advantage of String.intern() and compare with == operator? 

                
> [perf] store facelets MARK_CREATED and rendererType at UIComponentBase level
> ----------------------------------------------------------------------------
>
>                 Key: MYFACES-3488
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3488
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: JSR-314
>            Reporter: Leonardo Uribe
>            Assignee: Leonardo Uribe
>             Fix For: 2.0.13, 2.1.7
>
>
> Inspired on the suggestions done in MYFACES-3470 and MYFACES-3471, I have found a solution for both cases.
> MARK_CREATED and rendererType are special properties. Both are more related to the real UIComponent instance, which means those properties does not change for components inside a table (h:dataTable rowStatePreserved="true"). 
> In the case of MARK_CREATED, almost all components created by facelets uses it, and this is assigned when the view is built. It has only sense to save this value when the component needs to be restored fully, but since this is a property that does not change once created, it does not have sense to store it on the delta. 
> In the case of rendererType, the same as MARK_CREATED happens, but by the spec, it could be valid to set a ValueExpression for it and it is feasible to create a component, call markInitialState() and then call setRendererType(...), so this value could be saved on the delta.
> Components that are created without properties (for example h:panelGroup) only require these two properties, so storing these values at UIComponentBase it is possible to prevent create unnecessary Map.Entry instances. 

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