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čí (Created JIRA)" <de...@myfaces.apache.org> on 2012/02/24 21:07:49 UTC

[jira] [Created] (MYFACES-3475) [perf] Improve performance of HtmlResponseWriterImpl constructor

[perf] Improve performance of HtmlResponseWriterImpl constructor
----------------------------------------------------------------

                 Key: MYFACES-3475
                 URL: https://issues.apache.org/jira/browse/MYFACES-3475
             Project: MyFaces Core
          Issue Type: Improvement
    Affects Versions: 2.1.6, 2.0.12
            Reporter: Martin Kočí
            Assignee: Martin Kočí
            Priority: Trivial


HtmlResponseWriterImpl is a very light object created many times. But its constructor uses a memory intensive test if character encoding is valid:

            // validates the encoding, it will throw an UnsupportedEncodingException if the encoding is invalid
            try
            {
                new String("myfaces".getBytes(), characterEncoding);
            }
            catch (UnsupportedEncodingException e)
            {
                throw new IllegalArgumentException("Unsupported encoding: "+characterEncoding);
            }

this code is number 1. of byte [] allocations in my tests.

We can probably remove this check entirely: a exception  will be thrown a few moments later if encoding is not supported

Review other code in constructor too - it must be fast as possible.


--
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-3475) [perf] Improve performance of HtmlResponseWriterImpl constructor

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

Leonardo Uribe updated MYFACES-3475:
------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.7
                   2.0.13
           Status: Resolved  (was: Patch Available)

The check had sense in JSF 1.2/1.1, because in that time there was no standard way to handle ajax, and this was one way to check if everything was working correctly. 

It is ok to remove it. Thanks to Martin Koci for provide this patch.
                
> [perf] Improve performance of HtmlResponseWriterImpl constructor
> ----------------------------------------------------------------
>
>                 Key: MYFACES-3475
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3475
>             Project: MyFaces Core
>          Issue Type: Improvement
>    Affects Versions: 2.0.12, 2.1.6
>            Reporter: Martin Kočí
>            Assignee: Martin Kočí
>            Priority: Trivial
>             Fix For: 2.0.13, 2.1.7
>
>         Attachments: MYFACES-3475.patch
>
>
> HtmlResponseWriterImpl is a very light object created many times. But its constructor uses a memory intensive test if character encoding is valid:
>             // validates the encoding, it will throw an UnsupportedEncodingException if the encoding is invalid
>             try
>             {
>                 new String("myfaces".getBytes(), characterEncoding);
>             }
>             catch (UnsupportedEncodingException e)
>             {
>                 throw new IllegalArgumentException("Unsupported encoding: "+characterEncoding);
>             }
> this code is number 1. of byte [] allocations in my tests.
> We can probably remove this check entirely: a exception  will be thrown a few moments later if encoding is not supported
> Review other code in constructor too - it must be fast as possible.

--
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-3475) [perf] Improve performance of HtmlResponseWriterImpl constructor

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

Martin Kočí updated MYFACES-3475:
---------------------------------

    Status: Patch Available  (was: Open)
    
> [perf] Improve performance of HtmlResponseWriterImpl constructor
> ----------------------------------------------------------------
>
>                 Key: MYFACES-3475
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3475
>             Project: MyFaces Core
>          Issue Type: Improvement
>    Affects Versions: 2.0.12, 2.1.6
>            Reporter: Martin Kočí
>            Assignee: Martin Kočí
>            Priority: Trivial
>         Attachments: MYFACES-3475.patch
>
>
> HtmlResponseWriterImpl is a very light object created many times. But its constructor uses a memory intensive test if character encoding is valid:
>             // validates the encoding, it will throw an UnsupportedEncodingException if the encoding is invalid
>             try
>             {
>                 new String("myfaces".getBytes(), characterEncoding);
>             }
>             catch (UnsupportedEncodingException e)
>             {
>                 throw new IllegalArgumentException("Unsupported encoding: "+characterEncoding);
>             }
> this code is number 1. of byte [] allocations in my tests.
> We can probably remove this check entirely: a exception  will be thrown a few moments later if encoding is not supported
> Review other code in constructor too - it must be fast as possible.

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