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 2011/05/16 21:17:47 UTC

[jira] [Created] (MYFACES-3151) [perf] minimize ExternalContext.getInitPaparameter invocations

[perf] minimize ExternalContext.getInitPaparameter invocations
--------------------------------------------------------------

                 Key: MYFACES-3151
                 URL: https://issues.apache.org/jira/browse/MYFACES-3151
             Project: MyFaces Core
          Issue Type: Improvement
          Components: General
    Affects Versions: 2.1.0-SNAPSHOT
         Environment: myfaces core trunk
            Reporter: Martin Kočí
            Assignee: Martin Kočí
            Priority: Minor


init-param from webapp context cannot change - it is sufficient read it once in constructor (ApplicationImpl for example)

New problem (new in 2.1) is "great" javax.faces.HONOR_CURRENT_COMPONENT_ATTRIBUTES param for pushComponentToEL and popComponentFromEL - at least we can cache it in component (because push and pop are called more then ones during one lifecycle) and maybe cache it's value also in org.apache.myfaces.context.servlet.ServletExternalContextImplBase.getInitParameter(String)

I have about ~ 90 000 invocations of getInitPaparameter in my test case in one request/response and that is not cheap.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (MYFACES-3151) [perf] minimize ExternalContext.getInitPaparameter invocations

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

Jakob Korherr commented on MYFACES-3151:
----------------------------------------

I actually was thinking of introducing a config class that provides all config options in a typesafe way (kinda like RuntimeConfig does on shared) some time ago. This would also be possible in shared and impl, but in api it is proplematic, since the jsf-spec dictates the classes of api. Thus you would need to have a package private config cache class in every package in api which uses some kind of config parameter.

+1 on implementing such a feature on shared and using it on impl. But I guess for api we can't do much.

> [perf] minimize ExternalContext.getInitPaparameter invocations
> --------------------------------------------------------------
>
>                 Key: MYFACES-3151
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3151
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: General
>    Affects Versions: 2.1.0-SNAPSHOT
>         Environment: myfaces core trunk
>            Reporter: Martin Kočí
>            Assignee: Martin Kočí
>            Priority: Minor
>
> init-param from webapp context cannot change - it is sufficient read it once in constructor (ApplicationImpl for example)
> New problem (new in 2.1) is "great" javax.faces.HONOR_CURRENT_COMPONENT_ATTRIBUTES param for pushComponentToEL and popComponentFromEL - at least we can cache it in component (because push and pop are called more then ones during one lifecycle) and maybe cache it's value also in org.apache.myfaces.context.servlet.ServletExternalContextImplBase.getInitParameter(String)
> I have about ~ 90 000 invocations of getInitPaparameter in my test case in one request/response and that is not cheap.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (MYFACES-3151) [perf] minimize ExternalContext.getInitParameter invocations in myfaces API

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

Leonardo Uribe commented on MYFACES-3151:
-----------------------------------------

The patches looks good. I didn't knew that a lookup to FacesContext atttribute map is cheaper than one to external context initial parameters map. No objections from my side.

> [perf] minimize ExternalContext.getInitParameter invocations in myfaces API
> ---------------------------------------------------------------------------
>
>                 Key: MYFACES-3151
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3151
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: General
>    Affects Versions: 2.1.0-SNAPSHOT
>         Environment: myfaces core trunk
>            Reporter: Martin Kočí
>            Assignee: Martin Kočí
>            Priority: Minor
>         Attachments: MYFACES-3151-ApplicationImpl.patch, MYFACES-3151-UIComponent.patch, MYFACES-3151-UINamingContainer.patch
>
>
> init-param from webapp context cannot change - it is sufficient read it once in constructor (ApplicationImpl for example)
> New problem (new in 2.1) is "great" javax.faces.HONOR_CURRENT_COMPONENT_ATTRIBUTES param for pushComponentToEL and popComponentFromEL - at least we can cache it in component (because push and pop are called more then ones during one lifecycle) and maybe cache it's value also in org.apache.myfaces.context.servlet.ServletExternalContextImplBase.getInitParameter(String)
> I have about ~ 90 000 invocations of getInitPaparameter in my test case in one request/response and that is not cheap.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (MYFACES-3151) [perf] minimize ExternalContext.getInitParameter invocations in myfaces API

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

Martin Kočí resolved MYFACES-3151.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.0-SNAPSHOT

> [perf] minimize ExternalContext.getInitParameter invocations in myfaces API
> ---------------------------------------------------------------------------
>
>                 Key: MYFACES-3151
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3151
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: General
>    Affects Versions: 2.1.0-SNAPSHOT
>         Environment: myfaces core trunk
>            Reporter: Martin Kočí
>            Assignee: Martin Kočí
>            Priority: Minor
>             Fix For: 2.1.0-SNAPSHOT
>
>         Attachments: MYFACES-3151-ApplicationImpl.patch, MYFACES-3151-UIComponent.patch, MYFACES-3151-UINamingContainer.patch
>
>
> init-param from webapp context cannot change - it is sufficient read it once in constructor (ApplicationImpl for example)
> New problem (new in 2.1) is "great" javax.faces.HONOR_CURRENT_COMPONENT_ATTRIBUTES param for pushComponentToEL and popComponentFromEL - at least we can cache it in component (because push and pop are called more then ones during one lifecycle) and maybe cache it's value also in org.apache.myfaces.context.servlet.ServletExternalContextImplBase.getInitParameter(String)
> I have about ~ 90 000 invocations of getInitPaparameter in my test case in one request/response and that is not cheap.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (MYFACES-3151) [perf] minimize ExternalContext.getInitParameter invocations in myfaces API

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

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

I renamed this issue to "... invocations in myfaces API"; 

The main problem in api is/was big amount of getInitParameter invocation in push/popComponent in/fromEL and getCurrent(Composite)Component ;
second one is in UINamingContainer - javax.faces.SEPARATOR_CHAR parameter

please review patches; if no objection i'll commit it to trunk (2.1) because HONOR_CURRENT_COMPONENT_ATTRIBUTES
is new in 2.1 and cause measurable performance degradation; patch reduces it.


> [perf] minimize ExternalContext.getInitParameter invocations in myfaces API
> ---------------------------------------------------------------------------
>
>                 Key: MYFACES-3151
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3151
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: General
>    Affects Versions: 2.1.0-SNAPSHOT
>         Environment: myfaces core trunk
>            Reporter: Martin Kočí
>            Assignee: Martin Kočí
>            Priority: Minor
>         Attachments: MYFACES-3151-ApplicationImpl.patch, MYFACES-3151-UIComponent.patch, MYFACES-3151-UINamingContainer.patch
>
>
> init-param from webapp context cannot change - it is sufficient read it once in constructor (ApplicationImpl for example)
> New problem (new in 2.1) is "great" javax.faces.HONOR_CURRENT_COMPONENT_ATTRIBUTES param for pushComponentToEL and popComponentFromEL - at least we can cache it in component (because push and pop are called more then ones during one lifecycle) and maybe cache it's value also in org.apache.myfaces.context.servlet.ServletExternalContextImplBase.getInitParameter(String)
> I have about ~ 90 000 invocations of getInitPaparameter in my test case in one request/response and that is not cheap.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (MYFACES-3151) [perf] minimize ExternalContext.getInitParameter invocations in myfaces API

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

Jakob Korherr commented on MYFACES-3151:
----------------------------------------

Well, that may depend on the Servlet Container you're using, but I agree that it is (or may be) cheaper.

> [perf] minimize ExternalContext.getInitParameter invocations in myfaces API
> ---------------------------------------------------------------------------
>
>                 Key: MYFACES-3151
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3151
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: General
>    Affects Versions: 2.1.0-SNAPSHOT
>         Environment: myfaces core trunk
>            Reporter: Martin Kočí
>            Assignee: Martin Kočí
>            Priority: Minor
>         Attachments: MYFACES-3151-ApplicationImpl.patch, MYFACES-3151-UIComponent.patch, MYFACES-3151-UINamingContainer.patch
>
>
> init-param from webapp context cannot change - it is sufficient read it once in constructor (ApplicationImpl for example)
> New problem (new in 2.1) is "great" javax.faces.HONOR_CURRENT_COMPONENT_ATTRIBUTES param for pushComponentToEL and popComponentFromEL - at least we can cache it in component (because push and pop are called more then ones during one lifecycle) and maybe cache it's value also in org.apache.myfaces.context.servlet.ServletExternalContextImplBase.getInitParameter(String)
> I have about ~ 90 000 invocations of getInitPaparameter in my test case in one request/response and that is not cheap.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira