You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Krashan Brahmanjara (Created) (JIRA)" <de...@myfaces.apache.org> on 2012/04/18 11:36:37 UTC

[jira] [Created] (MYFACES-3528) CLONE - Performance Improvements

CLONE - Performance Improvements
--------------------------------

                 Key: MYFACES-3528
                 URL: https://issues.apache.org/jira/browse/MYFACES-3528
             Project: MyFaces Core
          Issue Type: Improvement
            Reporter: Krashan Brahmanjara
            Assignee: Martin Marinschek
             Fix For: 1.2.2


Last week I did some JMeter testing, profiling and code checking on MyFaces to try increase the overall performance. Here are my suggestions for improvement:

*) _ComponentAttributesMap
I introduced a cache for maps with component attributes. This cache avoids rebuilding the map for every instance of the same component class. It is implemented using a WeakHashMap to allow the GC to remove entries that are not referenced in any instance.

*) UIComponentBase
Made a few changes in isIdValid as it is called quite often. The new id is now checked against the old id and if it is the same it is assumed as valid (avoids checking chars). Additionally I use isLetterOrDigit() and access string chars directly insted of fetching an array first.

*) ImplicitObjectResolver
I replaced List with Map to avoid iteration over lists.

*) HtmlResponseWriterImpl
Use new method of HTMLEncoder for char[]

*) HTMLEncoder
Improved performance of encode mthod and added a new one that takes a char[] und directly writes to a writer.

*) UnicodeEncoder
Replaced StringBuffer with StringBuilder.

--
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] [Updated] (MYFACES-3528) CLONE - Performance Improvements

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

Krashan Brahmanjara updated MYFACES-3528:
-----------------------------------------

    Status: Patch Available  (was: Open)
    
> CLONE - Performance Improvements
> --------------------------------
>
>                 Key: MYFACES-3528
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3528
>             Project: MyFaces Core
>          Issue Type: Improvement
>            Reporter: Krashan Brahmanjara
>            Assignee: Martin Marinschek
>             Fix For: 1.2.2
>
>         Attachments: ApplicationImpl.java, _ComponentAttributesMap.java
>
>
> Last week I did some JMeter testing, profiling and code checking on MyFaces to try increase the overall performance. Here are my suggestions for improvement:
> *) _ComponentAttributesMap
> I introduced a cache for maps with component attributes. This cache avoids rebuilding the map for every instance of the same component class. It is implemented using a WeakHashMap to allow the GC to remove entries that are not referenced in any instance.
> *) UIComponentBase
> Made a few changes in isIdValid as it is called quite often. The new id is now checked against the old id and if it is the same it is assumed as valid (avoids checking chars). Additionally I use isLetterOrDigit() and access string chars directly insted of fetching an array first.
> *) ImplicitObjectResolver
> I replaced List with Map to avoid iteration over lists.
> *) HtmlResponseWriterImpl
> Use new method of HTMLEncoder for char[]
> *) HTMLEncoder
> Improved performance of encode mthod and added a new one that takes a char[] und directly writes to a writer.
> *) UnicodeEncoder
> Replaced StringBuffer with StringBuilder.

--
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] [Issue Comment Edited] (MYFACES-3528) CLONE - Performance Improvements

Posted by "Krashan Brahmanjara (Issue Comment Edited) (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-3528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13258156#comment-13258156 ] 

Krashan Brahmanjara edited comment on MYFACES-3528 at 4/20/12 11:44 AM:
------------------------------------------------------------------------

_ComponentAttributesMap.java -  improvements from MYFACES-1749, MYFACES-1850 and MYFACES-3216 in jsf 1.2 merged into
http://svn.apache.org/repos/asf/myfaces/core/branches/1.1.x/api/src/main/java/javax/faces/component/_ComponentAttributesMap.java
                
      was (Author: krokodylowy3):
    Merged improvements from MYFACES-1749, MYFACES-1850 and MYFACES-3216
                  
> CLONE - Performance Improvements
> --------------------------------
>
>                 Key: MYFACES-3528
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3528
>             Project: MyFaces Core
>          Issue Type: Improvement
>            Reporter: Krashan Brahmanjara
>            Assignee: Martin Marinschek
>             Fix For: 1.2.2
>
>         Attachments: ApplicationImpl.java, _ComponentAttributesMap.java
>
>
> Last week I did some JMeter testing, profiling and code checking on MyFaces to try increase the overall performance. Here are my suggestions for improvement:
> *) _ComponentAttributesMap
> I introduced a cache for maps with component attributes. This cache avoids rebuilding the map for every instance of the same component class. It is implemented using a WeakHashMap to allow the GC to remove entries that are not referenced in any instance.
> *) UIComponentBase
> Made a few changes in isIdValid as it is called quite often. The new id is now checked against the old id and if it is the same it is assumed as valid (avoids checking chars). Additionally I use isLetterOrDigit() and access string chars directly insted of fetching an array first.
> *) ImplicitObjectResolver
> I replaced List with Map to avoid iteration over lists.
> *) HtmlResponseWriterImpl
> Use new method of HTMLEncoder for char[]
> *) HTMLEncoder
> Improved performance of encode mthod and added a new one that takes a char[] und directly writes to a writer.
> *) UnicodeEncoder
> Replaced StringBuffer with StringBuilder.

--
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] [Issue Comment Edited] (MYFACES-3528) CLONE - Performance Improvements

Posted by "Krashan Brahmanjara (Issue Comment Edited) (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-3528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13258157#comment-13258157 ] 

Krashan Brahmanjara edited comment on MYFACES-3528 at 4/20/12 11:35 AM:
------------------------------------------------------------------------

Merged improvements from MYFACES-1749
                
      was (Author: krokodylowy3):
    Merged improvements MYFACES-1749
                  
> CLONE - Performance Improvements
> --------------------------------
>
>                 Key: MYFACES-3528
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3528
>             Project: MyFaces Core
>          Issue Type: Improvement
>            Reporter: Krashan Brahmanjara
>            Assignee: Martin Marinschek
>             Fix For: 1.2.2
>
>         Attachments: ApplicationImpl.java, _ComponentAttributesMap.java
>
>
> Last week I did some JMeter testing, profiling and code checking on MyFaces to try increase the overall performance. Here are my suggestions for improvement:
> *) _ComponentAttributesMap
> I introduced a cache for maps with component attributes. This cache avoids rebuilding the map for every instance of the same component class. It is implemented using a WeakHashMap to allow the GC to remove entries that are not referenced in any instance.
> *) UIComponentBase
> Made a few changes in isIdValid as it is called quite often. The new id is now checked against the old id and if it is the same it is assumed as valid (avoids checking chars). Additionally I use isLetterOrDigit() and access string chars directly insted of fetching an array first.
> *) ImplicitObjectResolver
> I replaced List with Map to avoid iteration over lists.
> *) HtmlResponseWriterImpl
> Use new method of HTMLEncoder for char[]
> *) HTMLEncoder
> Improved performance of encode mthod and added a new one that takes a char[] und directly writes to a writer.
> *) UnicodeEncoder
> Replaced StringBuffer with StringBuilder.

--
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-3528) CLONE - Performance Improvements

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

Krashan Brahmanjara commented on MYFACES-3528:
----------------------------------------------

Please apply this patch also to the 1.1 branch.
                
> CLONE - Performance Improvements
> --------------------------------
>
>                 Key: MYFACES-3528
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3528
>             Project: MyFaces Core
>          Issue Type: Improvement
>            Reporter: Krashan Brahmanjara
>            Assignee: Martin Marinschek
>             Fix For: 1.2.2
>
>
> Last week I did some JMeter testing, profiling and code checking on MyFaces to try increase the overall performance. Here are my suggestions for improvement:
> *) _ComponentAttributesMap
> I introduced a cache for maps with component attributes. This cache avoids rebuilding the map for every instance of the same component class. It is implemented using a WeakHashMap to allow the GC to remove entries that are not referenced in any instance.
> *) UIComponentBase
> Made a few changes in isIdValid as it is called quite often. The new id is now checked against the old id and if it is the same it is assumed as valid (avoids checking chars). Additionally I use isLetterOrDigit() and access string chars directly insted of fetching an array first.
> *) ImplicitObjectResolver
> I replaced List with Map to avoid iteration over lists.
> *) HtmlResponseWriterImpl
> Use new method of HTMLEncoder for char[]
> *) HTMLEncoder
> Improved performance of encode mthod and added a new one that takes a char[] und directly writes to a writer.
> *) UnicodeEncoder
> Replaced StringBuffer with StringBuilder.

--
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] [Issue Comment Edited] (MYFACES-3528) CLONE - Performance Improvements

Posted by "Krashan Brahmanjara (Issue Comment Edited) (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-3528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13258160#comment-13258160 ] 

Krashan Brahmanjara edited comment on MYFACES-3528 at 4/20/12 11:46 AM:
------------------------------------------------------------------------

This patch can help users of old apps based on Myfaces 1.1 with problems like:
 MYFACES-1162  (_ComponentAttributesMap.getPropertyDescriptor appears to get hung in a HashMap under peak load.)
or
 MYFACES-3442 (infinite loop under heavy load)
                
      was (Author: krokodylowy3):
    This patch can help users of myfaces 1.1 with infinite loop problems like:
 MYFACES-1162  (_ComponentAttributesMap.getPropertyDescriptor appears to get hung in a HashMap under peak load.)
or
 MYFACES-3442 (infinite loop under heavy load)
                  
> CLONE - Performance Improvements
> --------------------------------
>
>                 Key: MYFACES-3528
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3528
>             Project: MyFaces Core
>          Issue Type: Improvement
>            Reporter: Krashan Brahmanjara
>            Assignee: Martin Marinschek
>             Fix For: 1.2.2
>
>         Attachments: ApplicationImpl.java, _ComponentAttributesMap.java
>
>
> Last week I did some JMeter testing, profiling and code checking on MyFaces to try increase the overall performance. Here are my suggestions for improvement:
> *) _ComponentAttributesMap
> I introduced a cache for maps with component attributes. This cache avoids rebuilding the map for every instance of the same component class. It is implemented using a WeakHashMap to allow the GC to remove entries that are not referenced in any instance.
> *) UIComponentBase
> Made a few changes in isIdValid as it is called quite often. The new id is now checked against the old id and if it is the same it is assumed as valid (avoids checking chars). Additionally I use isLetterOrDigit() and access string chars directly insted of fetching an array first.
> *) ImplicitObjectResolver
> I replaced List with Map to avoid iteration over lists.
> *) HtmlResponseWriterImpl
> Use new method of HTMLEncoder for char[]
> *) HTMLEncoder
> Improved performance of encode mthod and added a new one that takes a char[] und directly writes to a writer.
> *) UnicodeEncoder
> Replaced StringBuffer with StringBuilder.

--
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] [Issue Comment Edited] (MYFACES-3528) CLONE - Performance Improvements

Posted by "Krashan Brahmanjara (Issue Comment Edited) (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-3528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13258157#comment-13258157 ] 

Krashan Brahmanjara edited comment on MYFACES-3528 at 4/20/12 11:43 AM:
------------------------------------------------------------------------

ApplicationImpl.java - improvements from MYFACES-1749 jsf 1.2 merged into http://svn.apache.org/repos/asf/myfaces/core/branches/1.1.x/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java
                
      was (Author: krokodylowy3):
    Merged improvements from MYFACES-1749
                  
> CLONE - Performance Improvements
> --------------------------------
>
>                 Key: MYFACES-3528
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3528
>             Project: MyFaces Core
>          Issue Type: Improvement
>            Reporter: Krashan Brahmanjara
>            Assignee: Martin Marinschek
>             Fix For: 1.2.2
>
>         Attachments: ApplicationImpl.java, _ComponentAttributesMap.java
>
>
> Last week I did some JMeter testing, profiling and code checking on MyFaces to try increase the overall performance. Here are my suggestions for improvement:
> *) _ComponentAttributesMap
> I introduced a cache for maps with component attributes. This cache avoids rebuilding the map for every instance of the same component class. It is implemented using a WeakHashMap to allow the GC to remove entries that are not referenced in any instance.
> *) UIComponentBase
> Made a few changes in isIdValid as it is called quite often. The new id is now checked against the old id and if it is the same it is assumed as valid (avoids checking chars). Additionally I use isLetterOrDigit() and access string chars directly insted of fetching an array first.
> *) ImplicitObjectResolver
> I replaced List with Map to avoid iteration over lists.
> *) HtmlResponseWriterImpl
> Use new method of HTMLEncoder for char[]
> *) HTMLEncoder
> Improved performance of encode mthod and added a new one that takes a char[] und directly writes to a writer.
> *) UnicodeEncoder
> Replaced StringBuffer with StringBuilder.

--
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-3528) CLONE - Performance Improvements

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

Leonardo Uribe commented on MYFACES-3528:
-----------------------------------------

A lot of improvements has been already done in 2.1.x / 2.0.x, but they are not ported yet to 1.2.x / 1.1.x because since these two versions are in maintenance stage, care must be taken to ensure do not break existing applications, and most of the interest is in JSF 2.0/2.1/2.2. If you provide a patch, I'll check it and commit it for you. Note for most of the changes, it s a "backport", which means just take the improvement from 2.0.x or 1.2.x and apply it in 1.1.x.
                
> CLONE - Performance Improvements
> --------------------------------
>
>                 Key: MYFACES-3528
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3528
>             Project: MyFaces Core
>          Issue Type: Improvement
>            Reporter: Krashan Brahmanjara
>            Assignee: Martin Marinschek
>             Fix For: 1.2.2
>
>
> Last week I did some JMeter testing, profiling and code checking on MyFaces to try increase the overall performance. Here are my suggestions for improvement:
> *) _ComponentAttributesMap
> I introduced a cache for maps with component attributes. This cache avoids rebuilding the map for every instance of the same component class. It is implemented using a WeakHashMap to allow the GC to remove entries that are not referenced in any instance.
> *) UIComponentBase
> Made a few changes in isIdValid as it is called quite often. The new id is now checked against the old id and if it is the same it is assumed as valid (avoids checking chars). Additionally I use isLetterOrDigit() and access string chars directly insted of fetching an array first.
> *) ImplicitObjectResolver
> I replaced List with Map to avoid iteration over lists.
> *) HtmlResponseWriterImpl
> Use new method of HTMLEncoder for char[]
> *) HTMLEncoder
> Improved performance of encode mthod and added a new one that takes a char[] und directly writes to a writer.
> *) UnicodeEncoder
> Replaced StringBuffer with StringBuilder.

--
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-3528) CLONE - Performance Improvements

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

Krashan Brahmanjara commented on MYFACES-3528:
----------------------------------------------

This patch can help users of myfaces 1.1 with infinite loop problems like:
 MYFACES-1162  (_ComponentAttributesMap.getPropertyDescriptor appears to get hung in a HashMap under peak load.)
or
 MYFACES-3442 (infinite loop under heavy load)
                
> CLONE - Performance Improvements
> --------------------------------
>
>                 Key: MYFACES-3528
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3528
>             Project: MyFaces Core
>          Issue Type: Improvement
>            Reporter: Krashan Brahmanjara
>            Assignee: Martin Marinschek
>             Fix For: 1.2.2
>
>         Attachments: ApplicationImpl.java, _ComponentAttributesMap.java
>
>
> Last week I did some JMeter testing, profiling and code checking on MyFaces to try increase the overall performance. Here are my suggestions for improvement:
> *) _ComponentAttributesMap
> I introduced a cache for maps with component attributes. This cache avoids rebuilding the map for every instance of the same component class. It is implemented using a WeakHashMap to allow the GC to remove entries that are not referenced in any instance.
> *) UIComponentBase
> Made a few changes in isIdValid as it is called quite often. The new id is now checked against the old id and if it is the same it is assumed as valid (avoids checking chars). Additionally I use isLetterOrDigit() and access string chars directly insted of fetching an array first.
> *) ImplicitObjectResolver
> I replaced List with Map to avoid iteration over lists.
> *) HtmlResponseWriterImpl
> Use new method of HTMLEncoder for char[]
> *) HTMLEncoder
> Improved performance of encode mthod and added a new one that takes a char[] und directly writes to a writer.
> *) UnicodeEncoder
> Replaced StringBuffer with StringBuilder.

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