You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Michael Concini (JIRA)" <de...@myfaces.apache.org> on 2010/06/30 22:25:50 UTC

[jira] Created: (MYFACES-2780) MyFaces performance improvements for production

MyFaces performance improvements for production 
------------------------------------------------

                 Key: MYFACES-2780
                 URL: https://issues.apache.org/jira/browse/MYFACES-2780
             Project: MyFaces Core
          Issue Type: Improvement
          Components: General
    Affects Versions: 2.0.0
            Reporter: Michael Concini
            Assignee: Michael Concini
            Priority: Minor


Several fixes to enhance startup memory footprint and runtime performance taking advantage of ProjectStage.

-lazy loading of validators, converters, behaviors,components - can have a substantial impact on startup footprint in applications with multiple or very large widget libraries.

Turn off some updating of resources for ProjectStage=Production by default (can always override using javax.faces.FACELETS_REFRESH_PERIOD)
-change default facelets refresh interval to -1 when projectStage is production.  This by itself gains a 60% improvement in throughput.
-disable reloading of web.xml and faces-config after the first load.  

-store a map to cache Class to listenerFor and resourceDependency annotations when in production.  


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


[jira] Commented: (MYFACES-2780) MyFaces performance improvements for production

Posted by "Jan-Kees van Andel (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12885873#action_12885873 ] 

Jan-Kees van Andel commented on MYFACES-2780:
---------------------------------------------

Lazy loading in itself is not a bad idea. Loading objects you're not using anyway is a waste of space and CPU, also at runtime, because the framework must look at more objects when, for example, doing a Converter lookup.

I'm just curious about how you're planning to implement this feature, because lazy loading requires some kind of coordination, which might become a bottleneck...

> MyFaces performance improvements for production 
> ------------------------------------------------
>
>                 Key: MYFACES-2780
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2780
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: General
>    Affects Versions: 2.0.0
>            Reporter: Michael Concini
>            Assignee: Michael Concini
>            Priority: Minor
>             Fix For: 2.0.1
>
>
> Several fixes to enhance startup memory footprint and runtime performance taking advantage of ProjectStage.
> -lazy loading of validators, converters, behaviors,components - can have a substantial impact on startup footprint in applications with multiple or very large widget libraries.
> Turn off some updating of resources for ProjectStage=Production by default (can always override using javax.faces.FACELETS_REFRESH_PERIOD)
> -change default facelets refresh interval to -1 when projectStage is production.  This by itself gains a 60% improvement in throughput.
> -disable reloading of web.xml and faces-config after the first load.  
> -store a map to cache Class to listenerFor and resourceDependency annotations when in production.  

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


[jira] Commented: (MYFACES-2780) MyFaces performance improvements for production

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

Michael Concini commented on MYFACES-2780:
------------------------------------------

ah...sorry about that.  I missed MYFACES-2764 or else I would've certainly committed the refresh period change under that issue.  Looks like conceptually we were in agreement about the behavior during production though.  

I would prefer to handle it as I've done in my update during factory creation time so we only need to check the context param once and not with every request.  If you're ok with that, we can probably go ahead and resolve both of these issues. 

> MyFaces performance improvements for production 
> ------------------------------------------------
>
>                 Key: MYFACES-2780
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2780
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: General
>    Affects Versions: 2.0.0
>            Reporter: Michael Concini
>            Assignee: Michael Concini
>            Priority: Minor
>
> Several fixes to enhance startup memory footprint and runtime performance taking advantage of ProjectStage.
> -lazy loading of validators, converters, behaviors,components - can have a substantial impact on startup footprint in applications with multiple or very large widget libraries.
> Turn off some updating of resources for ProjectStage=Production by default (can always override using javax.faces.FACELETS_REFRESH_PERIOD)
> -change default facelets refresh interval to -1 when projectStage is production.  This by itself gains a 60% improvement in throughput.
> -disable reloading of web.xml and faces-config after the first load.  
> -store a map to cache Class to listenerFor and resourceDependency annotations when in production.  

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


[jira] Commented: (MYFACES-2780) MyFaces performance improvements for production

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

Martin Marinschek commented on MYFACES-2780:
--------------------------------------------

Well, I am ok with lazy loading if it does not change the request times, also not the ones for the first request. How much loading do you defer - is it changing the time needed for processing a request?

In any case, I guess this should be configurable.

best regards,

Martin

> MyFaces performance improvements for production 
> ------------------------------------------------
>
>                 Key: MYFACES-2780
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2780
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: General
>    Affects Versions: 2.0.0
>            Reporter: Michael Concini
>            Assignee: Michael Concini
>            Priority: Minor
>             Fix For: 2.0.1
>
>
> Several fixes to enhance startup memory footprint and runtime performance taking advantage of ProjectStage.
> -lazy loading of validators, converters, behaviors,components - can have a substantial impact on startup footprint in applications with multiple or very large widget libraries.
> Turn off some updating of resources for ProjectStage=Production by default (can always override using javax.faces.FACELETS_REFRESH_PERIOD)
> -change default facelets refresh interval to -1 when projectStage is production.  This by itself gains a 60% improvement in throughput.
> -disable reloading of web.xml and faces-config after the first load.  
> -store a map to cache Class to listenerFor and resourceDependency annotations when in production.  

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


[jira] Commented: (MYFACES-2780) MyFaces performance improvements for production

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

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

Similar isssue: https://issues.apache.org/jira/browse/MYFACES-2764



> MyFaces performance improvements for production 
> ------------------------------------------------
>
>                 Key: MYFACES-2780
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2780
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: General
>    Affects Versions: 2.0.0
>            Reporter: Michael Concini
>            Assignee: Michael Concini
>            Priority: Minor
>
> Several fixes to enhance startup memory footprint and runtime performance taking advantage of ProjectStage.
> -lazy loading of validators, converters, behaviors,components - can have a substantial impact on startup footprint in applications with multiple or very large widget libraries.
> Turn off some updating of resources for ProjectStage=Production by default (can always override using javax.faces.FACELETS_REFRESH_PERIOD)
> -change default facelets refresh interval to -1 when projectStage is production.  This by itself gains a 60% improvement in throughput.
> -disable reloading of web.xml and faces-config after the first load.  
> -store a map to cache Class to listenerFor and resourceDependency annotations when in production.  

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


[jira] Commented: (MYFACES-2780) MyFaces performance improvements for production

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

Martin Marinschek commented on MYFACES-2780:
--------------------------------------------

Hi Mike,

thanks for the parameter!

Do you (anyways) have an idea of how much the lazy loading influences the request processing of the first request? How much are the typical memory savings for a large component library? Just so that our users have something to chew on ;)

best regards,

Martin

> MyFaces performance improvements for production 
> ------------------------------------------------
>
>                 Key: MYFACES-2780
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2780
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: General
>    Affects Versions: 2.0.0
>            Reporter: Michael Concini
>            Assignee: Michael Concini
>            Priority: Minor
>             Fix For: 2.0.1
>
>
> Several fixes to enhance startup memory footprint and runtime performance taking advantage of ProjectStage.
> -lazy loading of validators, converters, behaviors,components - can have a substantial impact on startup footprint in applications with multiple or very large widget libraries.
> Turn off some updating of resources for ProjectStage=Production by default (can always override using javax.faces.FACELETS_REFRESH_PERIOD)
> -change default facelets refresh interval to -1 when projectStage is production.  This by itself gains a 60% improvement in throughput.
> -disable reloading of web.xml and faces-config after the first load.  
> -store a map to cache Class to listenerFor and resourceDependency annotations when in production.  

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


[jira] Resolved: (MYFACES-2780) MyFaces performance improvements for production

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

Michael Concini resolved MYFACES-2780.
--------------------------------------

    Fix Version/s: 2.0.1
       Resolution: Fixed

> MyFaces performance improvements for production 
> ------------------------------------------------
>
>                 Key: MYFACES-2780
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2780
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: General
>    Affects Versions: 2.0.0
>            Reporter: Michael Concini
>            Assignee: Michael Concini
>            Priority: Minor
>             Fix For: 2.0.1
>
>
> Several fixes to enhance startup memory footprint and runtime performance taking advantage of ProjectStage.
> -lazy loading of validators, converters, behaviors,components - can have a substantial impact on startup footprint in applications with multiple or very large widget libraries.
> Turn off some updating of resources for ProjectStage=Production by default (can always override using javax.faces.FACELETS_REFRESH_PERIOD)
> -change default facelets refresh interval to -1 when projectStage is production.  This by itself gains a 60% improvement in throughput.
> -disable reloading of web.xml and faces-config after the first load.  
> -store a map to cache Class to listenerFor and resourceDependency annotations when in production.  

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


[jira] Commented: (MYFACES-2780) MyFaces performance improvements for production

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

Michael Concini commented on MYFACES-2780:
------------------------------------------

Sorry for the delay in responding...I've been locked into a customer situation the past few days and haven't had any time to catch up until now.  

I've got a change I'm going to commit this morning to allow users to disable lazy loading via a context param.

To answer your questions about the implementation, it is a pretty simple design.  Using a converter as an example:

Previously, during startup we would execute Class.forName() against the classname passed in for a named Converter and store converter name -> convert Class object on the map.  Then during each request, we call newInstance on the class object if that converter is used.  

Now, during startup we simply store the classname on the map during startup, and save executing the Class.forName() lookup until the first request that uses that object.  Upon that first request, we then swap out the classname String for the Class object on the map and continue on with the same processing as before.  Then on subsequent calls the Class object is already on the Map so all would function exactly the same as it did previously. 


> MyFaces performance improvements for production 
> ------------------------------------------------
>
>                 Key: MYFACES-2780
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2780
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: General
>    Affects Versions: 2.0.0
>            Reporter: Michael Concini
>            Assignee: Michael Concini
>            Priority: Minor
>             Fix For: 2.0.1
>
>
> Several fixes to enhance startup memory footprint and runtime performance taking advantage of ProjectStage.
> -lazy loading of validators, converters, behaviors,components - can have a substantial impact on startup footprint in applications with multiple or very large widget libraries.
> Turn off some updating of resources for ProjectStage=Production by default (can always override using javax.faces.FACELETS_REFRESH_PERIOD)
> -change default facelets refresh interval to -1 when projectStage is production.  This by itself gains a 60% improvement in throughput.
> -disable reloading of web.xml and faces-config after the first load.  
> -store a map to cache Class to listenerFor and resourceDependency annotations when in production.  

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


[jira] Commented: (MYFACES-2780) MyFaces performance improvements for production

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

Martin Marinschek commented on MYFACES-2780:
--------------------------------------------

Hi guys,

how is lazy loading good for production performance? In production, I would expect everything to be initialized on startup - so that request times are as low as possible (and certainly not the first request is taking longer than all other requests). Startup is not so much an issue in production! That's why everyone precompiles JSPs in production.

best regards,

Martin

> MyFaces performance improvements for production 
> ------------------------------------------------
>
>                 Key: MYFACES-2780
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2780
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: General
>    Affects Versions: 2.0.0
>            Reporter: Michael Concini
>            Assignee: Michael Concini
>            Priority: Minor
>             Fix For: 2.0.1
>
>
> Several fixes to enhance startup memory footprint and runtime performance taking advantage of ProjectStage.
> -lazy loading of validators, converters, behaviors,components - can have a substantial impact on startup footprint in applications with multiple or very large widget libraries.
> Turn off some updating of resources for ProjectStage=Production by default (can always override using javax.faces.FACELETS_REFRESH_PERIOD)
> -change default facelets refresh interval to -1 when projectStage is production.  This by itself gains a 60% improvement in throughput.
> -disable reloading of web.xml and faces-config after the first load.  
> -store a map to cache Class to listenerFor and resourceDependency annotations when in production.  

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


[jira] Commented: (MYFACES-2780) MyFaces performance improvements for production

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

Michael Concini commented on MYFACES-2780:
------------------------------------------

Startup footprint can be an issue in production in many cases, especially when you take into considerations virtual machine environments where the memory allocated may be limited.  The reason in particular that this lazy loading would be effective in a production environment however is due to the previous behavior loading all application resources into memory that are described by large widgets libraries even if an application might only use a small subset of these.  It also is consistent with the behavior of the RI as they appear to be doing lazy loading after taking comparative heapdumps and analyzing classes loaded. 

Perhaps we should allow this to be configurable whether to load application resources lazy or aggressive?  

> MyFaces performance improvements for production 
> ------------------------------------------------
>
>                 Key: MYFACES-2780
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2780
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: General
>    Affects Versions: 2.0.0
>            Reporter: Michael Concini
>            Assignee: Michael Concini
>            Priority: Minor
>             Fix For: 2.0.1
>
>
> Several fixes to enhance startup memory footprint and runtime performance taking advantage of ProjectStage.
> -lazy loading of validators, converters, behaviors,components - can have a substantial impact on startup footprint in applications with multiple or very large widget libraries.
> Turn off some updating of resources for ProjectStage=Production by default (can always override using javax.faces.FACELETS_REFRESH_PERIOD)
> -change default facelets refresh interval to -1 when projectStage is production.  This by itself gains a 60% improvement in throughput.
> -disable reloading of web.xml and faces-config after the first load.  
> -store a map to cache Class to listenerFor and resourceDependency annotations when in production.  

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


[jira] Commented: (MYFACES-2780) MyFaces performance improvements for production

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

Michael Concini commented on MYFACES-2780:
------------------------------------------

unfortunately, I can't provide the the measurement data right now because the  testing is being done on pre-release WAS8 builds so there are legal and issues involved with releasing any performance numbers.

Without going into precise numbers though, I can tell you that we're seeing a roughly 50% reduction in the classes being loaded for component libraries (tested using IBM JWL, Tomahawk as well as the base javax/faces components).  The change brings us roughly into line with what is loaded by the RI.  As far as request processing, there was very negligible change on the first request and no change in the overall request processing rate. 

> MyFaces performance improvements for production 
> ------------------------------------------------
>
>                 Key: MYFACES-2780
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2780
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: General
>    Affects Versions: 2.0.0
>            Reporter: Michael Concini
>            Assignee: Michael Concini
>            Priority: Minor
>             Fix For: 2.0.1
>
>
> Several fixes to enhance startup memory footprint and runtime performance taking advantage of ProjectStage.
> -lazy loading of validators, converters, behaviors,components - can have a substantial impact on startup footprint in applications with multiple or very large widget libraries.
> Turn off some updating of resources for ProjectStage=Production by default (can always override using javax.faces.FACELETS_REFRESH_PERIOD)
> -change default facelets refresh interval to -1 when projectStage is production.  This by itself gains a 60% improvement in throughput.
> -disable reloading of web.xml and faces-config after the first load.  
> -store a map to cache Class to listenerFor and resourceDependency annotations when in production.  

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


[jira] Commented: (MYFACES-2780) MyFaces performance improvements for production

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

Leonardo Uribe commented on MYFACES-2780:
-----------------------------------------

I did two small enhancements:

- use FacesContext.isProjectStage().
- It is not really necessary to call FacesConfigurator.update and WebXml.update on Lifecycle on the first request. The startup listener is the responsible to configure everything.

There is an opportunity on org.apache.myfaces.view.facelets.compiler.TagLibraryConfig. Basically TagLibraryImpl has methods to add tag handlers, so we can do the same as the proposal on ApplicationImpl.

> MyFaces performance improvements for production 
> ------------------------------------------------
>
>                 Key: MYFACES-2780
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2780
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: General
>    Affects Versions: 2.0.0
>            Reporter: Michael Concini
>            Assignee: Michael Concini
>            Priority: Minor
>             Fix For: 2.0.1
>
>
> Several fixes to enhance startup memory footprint and runtime performance taking advantage of ProjectStage.
> -lazy loading of validators, converters, behaviors,components - can have a substantial impact on startup footprint in applications with multiple or very large widget libraries.
> Turn off some updating of resources for ProjectStage=Production by default (can always override using javax.faces.FACELETS_REFRESH_PERIOD)
> -change default facelets refresh interval to -1 when projectStage is production.  This by itself gains a 60% improvement in throughput.
> -disable reloading of web.xml and faces-config after the first load.  
> -store a map to cache Class to listenerFor and resourceDependency annotations when in production.  

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