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 (JIRA)" <de...@myfaces.apache.org> on 2010/10/20 22:44:24 UTC

[jira] Created: (MYFACES-2951) [PERF] enhance scanning for #{cc} expressions

[PERF] enhance scanning for #{cc} expressions
---------------------------------------------

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


Reported by Martin Koci

MK>> a issue to consider in
MK>> org.apache.myfaces.view.facelets.tag.TagAttributeImpl:

MK>> Methods
MK>> TagAttributeImpl.getMethodExpression and
MK>> TagAttributeImpl.getValueExpression use
MK>> CompositeComponentELUtils.isCompositeComponentXYZ methods to detect if
MK>> current #{} contains cc expression. But consider following: if user
MK>> migrates from facelets 1.2 to 2.0, this new cc detection slows down
MK>> build view process. In one my test case VDL.buildView calls
MK>> CompositeComponentELUtils.isCompositeComponentXYZ approx 3000 times per
MK>> build view with no match. isCompositeComponentXYZ is not cheap method
MK>> because it uses Pattern.matches().

MK>> Are there possibilities to avoid this? For example is possible have some
MK>> kind of "isProcessingCompositeComponent" method and skip
MK>> Pattern.matches() if false? We are in VDL.buildView here and no
MK>> components are available yet, no use of methods like
MK>> UIComponent.isCompositeComponent(UIComponent) is possible.

See discussion on dev list:

[core] performance: TagAttributeImpl and composite component EL detection


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


[jira] Commented: (MYFACES-2951) [PERF] enhance scanning for #{cc} expressions

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

Jakob Korherr commented on MYFACES-2951:
----------------------------------------

In theory you're right, but I think if we could gain a huge performace improvement out of it, I think it's worth "breaking" this guideline.

> [PERF] enhance scanning for #{cc} expressions
> ---------------------------------------------
>
>                 Key: MYFACES-2951
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2951
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: JSR-314
>            Reporter: Leonardo Uribe
>            Assignee: Leonardo Uribe
>
> Reported by Martin Koci
> MK>> a issue to consider in
> MK>> org.apache.myfaces.view.facelets.tag.TagAttributeImpl:
> MK>> Methods
> MK>> TagAttributeImpl.getMethodExpression and
> MK>> TagAttributeImpl.getValueExpression use
> MK>> CompositeComponentELUtils.isCompositeComponentXYZ methods to detect if
> MK>> current #{} contains cc expression. But consider following: if user
> MK>> migrates from facelets 1.2 to 2.0, this new cc detection slows down
> MK>> build view process. In one my test case VDL.buildView calls
> MK>> CompositeComponentELUtils.isCompositeComponentXYZ approx 3000 times per
> MK>> build view with no match. isCompositeComponentXYZ is not cheap method
> MK>> because it uses Pattern.matches().
> MK>> Are there possibilities to avoid this? For example is possible have some
> MK>> kind of "isProcessingCompositeComponent" method and skip
> MK>> Pattern.matches() if false? We are in VDL.buildView here and no
> MK>> components are available yet, no use of methods like
> MK>> UIComponent.isCompositeComponent(UIComponent) is possible.
> See discussion on dev list:
> [core] performance: TagAttributeImpl and composite component EL detection

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


[jira] Resolved: (MYFACES-2951) [PERF] enhance scanning for #{cc} expressions

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

Leonardo Uribe resolved MYFACES-2951.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.3-SNAPSHOT

> [PERF] enhance scanning for #{cc} expressions
> ---------------------------------------------
>
>                 Key: MYFACES-2951
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2951
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: JSR-314
>            Reporter: Leonardo Uribe
>            Assignee: Leonardo Uribe
>             Fix For: 2.0.3-SNAPSHOT
>
>
> Reported by Martin Koci
> MK>> a issue to consider in
> MK>> org.apache.myfaces.view.facelets.tag.TagAttributeImpl:
> MK>> Methods
> MK>> TagAttributeImpl.getMethodExpression and
> MK>> TagAttributeImpl.getValueExpression use
> MK>> CompositeComponentELUtils.isCompositeComponentXYZ methods to detect if
> MK>> current #{} contains cc expression. But consider following: if user
> MK>> migrates from facelets 1.2 to 2.0, this new cc detection slows down
> MK>> build view process. In one my test case VDL.buildView calls
> MK>> CompositeComponentELUtils.isCompositeComponentXYZ approx 3000 times per
> MK>> build view with no match. isCompositeComponentXYZ is not cheap method
> MK>> because it uses Pattern.matches().
> MK>> Are there possibilities to avoid this? For example is possible have some
> MK>> kind of "isProcessingCompositeComponent" method and skip
> MK>> Pattern.matches() if false? We are in VDL.buildView here and no
> MK>> components are available yet, no use of methods like
> MK>> UIComponent.isCompositeComponent(UIComponent) is possible.
> See discussion on dev list:
> [core] performance: TagAttributeImpl and composite component EL detection

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


[jira] Commented: (MYFACES-2951) [PERF] enhance scanning for #{cc} expressions

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

Leonardo Uribe commented on MYFACES-2951:
-----------------------------------------

I committed these lines:

    private static final String CC = "cc";

    public static boolean isCompositeComponentExpression(String expression)
    {
        if (expression.contains(CC))
        {
            return CC_EXPRESSION_REGEX.matcher(expression).matches();
        }
        else
        {
            return false;
        }
    }

To discard many expressions in just one simple step. I hope that change will perform better.

I'm not very sure about isProcessingCompositeComponent, because it only has sense at build view time, and note the proposal committed moved the evaluation to the constructor. In theory, it is better to let the attribute "decoupled" from the component tree state.

> [PERF] enhance scanning for #{cc} expressions
> ---------------------------------------------
>
>                 Key: MYFACES-2951
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2951
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: JSR-314
>            Reporter: Leonardo Uribe
>            Assignee: Leonardo Uribe
>
> Reported by Martin Koci
> MK>> a issue to consider in
> MK>> org.apache.myfaces.view.facelets.tag.TagAttributeImpl:
> MK>> Methods
> MK>> TagAttributeImpl.getMethodExpression and
> MK>> TagAttributeImpl.getValueExpression use
> MK>> CompositeComponentELUtils.isCompositeComponentXYZ methods to detect if
> MK>> current #{} contains cc expression. But consider following: if user
> MK>> migrates from facelets 1.2 to 2.0, this new cc detection slows down
> MK>> build view process. In one my test case VDL.buildView calls
> MK>> CompositeComponentELUtils.isCompositeComponentXYZ approx 3000 times per
> MK>> build view with no match. isCompositeComponentXYZ is not cheap method
> MK>> because it uses Pattern.matches().
> MK>> Are there possibilities to avoid this? For example is possible have some
> MK>> kind of "isProcessingCompositeComponent" method and skip
> MK>> Pattern.matches() if false? We are in VDL.buildView here and no
> MK>> components are available yet, no use of methods like
> MK>> UIComponent.isCompositeComponent(UIComponent) is possible.
> See discussion on dev list:
> [core] performance: TagAttributeImpl and composite component EL detection

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


[jira] Commented: (MYFACES-2951) [PERF] enhance scanning for #{cc} expressions

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

Jakob Korherr commented on MYFACES-2951:
----------------------------------------

We can still also try to implement the isProcessingCompositeComponent-suggestion from Martin, because lots of components will be outside of composite components, I guess.

> [PERF] enhance scanning for #{cc} expressions
> ---------------------------------------------
>
>                 Key: MYFACES-2951
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2951
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: JSR-314
>            Reporter: Leonardo Uribe
>            Assignee: Leonardo Uribe
>
> Reported by Martin Koci
> MK>> a issue to consider in
> MK>> org.apache.myfaces.view.facelets.tag.TagAttributeImpl:
> MK>> Methods
> MK>> TagAttributeImpl.getMethodExpression and
> MK>> TagAttributeImpl.getValueExpression use
> MK>> CompositeComponentELUtils.isCompositeComponentXYZ methods to detect if
> MK>> current #{} contains cc expression. But consider following: if user
> MK>> migrates from facelets 1.2 to 2.0, this new cc detection slows down
> MK>> build view process. In one my test case VDL.buildView calls
> MK>> CompositeComponentELUtils.isCompositeComponentXYZ approx 3000 times per
> MK>> build view with no match. isCompositeComponentXYZ is not cheap method
> MK>> because it uses Pattern.matches().
> MK>> Are there possibilities to avoid this? For example is possible have some
> MK>> kind of "isProcessingCompositeComponent" method and skip
> MK>> Pattern.matches() if false? We are in VDL.buildView here and no
> MK>> components are available yet, no use of methods like
> MK>> UIComponent.isCompositeComponent(UIComponent) is possible.
> See discussion on dev list:
> [core] performance: TagAttributeImpl and composite component EL detection

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