You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Xiaoming Shi (JIRA)" <ji...@apache.org> on 2011/02/25 02:44:38 UTC

[jira] Created: (WW-3581) DateFormat.getDateTimeInstance() is very expensive, we can cache it to improve performance

DateFormat.getDateTimeInstance() is very expensive, we can cache it to improve performance
------------------------------------------------------------------------------------------

                 Key: WW-3581
                 URL: https://issues.apache.org/jira/browse/WW-3581
             Project: Struts 2
          Issue Type: Improvement
          Components: Core Actions
    Affects Versions: 2.2.1
            Reporter: Xiaoming Shi
            Priority: Critical


In the file
./struts-2.2.1/src/xwork-core/src/main/java/com/opensymphony/xwork2/validator/AnnotationValidationConfigurationBuilder.java  line:547

DateFormat.getDateTimeInstance() is called 3 times for each function call of "parseDateString"

We can add a class field to store the instances to improve performance.

Similar code can be found in (./struts-2.2.1/src/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkBasicConverter.java  line: 323)

(Similar to the Appache Bug https://issues.apache.org/bugzilla/show_bug.cgi?id=48778 )

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

        

[jira] Commented: (WW-3581) DateFormat.getDateTimeInstance() is very expensive, we can cache it to improve performance

Posted by "zhouyanming (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12999189#comment-12999189 ] 

zhouyanming commented on WW-3581:
---------------------------------

SimpleDateFormat is not thread safe,it's not cacheable.

> DateFormat.getDateTimeInstance() is very expensive, we can cache it to improve performance
> ------------------------------------------------------------------------------------------
>
>                 Key: WW-3581
>                 URL: https://issues.apache.org/jira/browse/WW-3581
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Actions
>    Affects Versions: 2.2.1
>            Reporter: Xiaoming Shi
>            Priority: Critical
>
> In the file
> ./struts-2.2.1/src/xwork-core/src/main/java/com/opensymphony/xwork2/validator/AnnotationValidationConfigurationBuilder.java  line:547
> DateFormat.getDateTimeInstance() is called 3 times for each function call of "parseDateString"
> We can add a class field to store the instances to improve performance.
> Similar code can be found in (./struts-2.2.1/src/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkBasicConverter.java  line: 323)
> (Similar to the Appache Bug https://issues.apache.org/bugzilla/show_bug.cgi?id=48778 )

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

        

[jira] Commented: (WW-3581) DateFormat.getDateTimeInstance() is very expensive, we can cache it to improve performance

Posted by "Xiaoming Shi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12999200#comment-12999200 ] 

Xiaoming Shi commented on WW-3581:
----------------------------------

I see. Thanks~

> DateFormat.getDateTimeInstance() is very expensive, we can cache it to improve performance
> ------------------------------------------------------------------------------------------
>
>                 Key: WW-3581
>                 URL: https://issues.apache.org/jira/browse/WW-3581
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Actions
>    Affects Versions: 2.2.1
>            Reporter: Xiaoming Shi
>            Priority: Critical
>
> In the file
> ./struts-2.2.1/src/xwork-core/src/main/java/com/opensymphony/xwork2/validator/AnnotationValidationConfigurationBuilder.java  line:547
> DateFormat.getDateTimeInstance() is called 3 times for each function call of "parseDateString"
> We can add a class field to store the instances to improve performance.
> Similar code can be found in (./struts-2.2.1/src/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkBasicConverter.java  line: 323)
> (Similar to the Appache Bug https://issues.apache.org/bugzilla/show_bug.cgi?id=48778 )

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

        

[jira] Closed: (WW-3581) DateFormat.getDateTimeInstance() is very expensive, we can cache it to improve performance

Posted by "Xiaoming Shi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WW-3581?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xiaoming Shi closed WW-3581.
----------------------------

    Resolution: Not A Problem

> DateFormat.getDateTimeInstance() is very expensive, we can cache it to improve performance
> ------------------------------------------------------------------------------------------
>
>                 Key: WW-3581
>                 URL: https://issues.apache.org/jira/browse/WW-3581
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Actions
>    Affects Versions: 2.2.1
>            Reporter: Xiaoming Shi
>            Priority: Critical
>
> In the file
> ./struts-2.2.1/src/xwork-core/src/main/java/com/opensymphony/xwork2/validator/AnnotationValidationConfigurationBuilder.java  line:547
> DateFormat.getDateTimeInstance() is called 3 times for each function call of "parseDateString"
> We can add a class field to store the instances to improve performance.
> Similar code can be found in (./struts-2.2.1/src/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkBasicConverter.java  line: 323)
> (Similar to the Appache Bug https://issues.apache.org/bugzilla/show_bug.cgi?id=48778 )

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