You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Regis Xu (JIRA)" <ji...@apache.org> on 2008/08/26 06:31:44 UTC
[jira] Created: (HARMONY-5958) [classlib][sql][performance] -
improve performance of java.sql.Date/Time/Timestamp.toString()
[classlib][sql][performance] - improve performance of java.sql.Date/Time/Timestamp.toString()
---------------------------------------------------------------------------------------------
Key: HARMONY-5958
URL: https://issues.apache.org/jira/browse/HARMONY-5958
Project: Harmony
Issue Type: Improvement
Components: Classlib
Affects Versions: 5.0M6
Reporter: Regis Xu
Fix For: 5.0M8
java.sql.Date/Time/Timestamp.toString() use SimpleDateFormat and DecimalFormat to generate string format of the date, which is too slow and complex for the toString() methods.
I re-implement them by hand, and boost the speed a lot. I will attach the patch soon.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-5958) [classlib][sql][performance] -
improve performance of java.sql.Date/Time/Timestamp.toString()
Posted by "Regis Xu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Regis Xu updated HARMONY-5958:
------------------------------
Attachment: HARMONY-5958.diff
Would anyone want to try this?
> [classlib][sql][performance] - improve performance of java.sql.Date/Time/Timestamp.toString()
> ---------------------------------------------------------------------------------------------
>
> Key: HARMONY-5958
> URL: https://issues.apache.org/jira/browse/HARMONY-5958
> Project: Harmony
> Issue Type: Improvement
> Components: Classlib
> Affects Versions: 5.0M6
> Reporter: Regis Xu
> Fix For: 5.0M8
>
> Attachments: HARMONY-5958.diff
>
>
> java.sql.Date/Time/Timestamp.toString() use SimpleDateFormat and DecimalFormat to generate string format of the date, which is too slow and complex for the toString() methods.
> I re-implement them by hand, and boost the speed a lot. I will attach the patch soon.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (HARMONY-5958) [classlib][sql][performance] -
improve performance of java.sql.Date/Time/Timestamp.toString()
Posted by "Sean Qiu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sean Qiu resolved HARMONY-5958.
-------------------------------
Resolution: Fixed
Applied at r689001.
Please verify if it works as you expected.
Thank you.
> [classlib][sql][performance] - improve performance of java.sql.Date/Time/Timestamp.toString()
> ---------------------------------------------------------------------------------------------
>
> Key: HARMONY-5958
> URL: https://issues.apache.org/jira/browse/HARMONY-5958
> Project: Harmony
> Issue Type: Improvement
> Components: Classlib
> Affects Versions: 5.0M6
> Reporter: Regis Xu
> Assignee: Sean Qiu
> Fix For: 5.0M8
>
> Attachments: HARMONY-5958.diff
>
>
> java.sql.Date/Time/Timestamp.toString() use SimpleDateFormat and DecimalFormat to generate string format of the date, which is too slow and complex for the toString() methods.
> I re-implement them by hand, and boost the speed a lot. I will attach the patch soon.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (HARMONY-5958) [classlib][sql][performance] -
improve performance of java.sql.Date/Time/Timestamp.toString()
Posted by "Regis Xu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Regis Xu closed HARMONY-5958.
-----------------------------
Verified. Thanks Sean.
> [classlib][sql][performance] - improve performance of java.sql.Date/Time/Timestamp.toString()
> ---------------------------------------------------------------------------------------------
>
> Key: HARMONY-5958
> URL: https://issues.apache.org/jira/browse/HARMONY-5958
> Project: Harmony
> Issue Type: Improvement
> Components: Classlib
> Affects Versions: 5.0M6
> Reporter: Regis Xu
> Assignee: Sean Qiu
> Fix For: 5.0M8
>
> Attachments: HARMONY-5958.diff
>
>
> java.sql.Date/Time/Timestamp.toString() use SimpleDateFormat and DecimalFormat to generate string format of the date, which is too slow and complex for the toString() methods.
> I re-implement them by hand, and boost the speed a lot. I will attach the patch soon.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (HARMONY-5958) [classlib][sql][performance] -
improve performance of java.sql.Date/Time/Timestamp.toString()
Posted by "Sean Qiu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sean Qiu reassigned HARMONY-5958:
---------------------------------
Assignee: Sean Qiu
> [classlib][sql][performance] - improve performance of java.sql.Date/Time/Timestamp.toString()
> ---------------------------------------------------------------------------------------------
>
> Key: HARMONY-5958
> URL: https://issues.apache.org/jira/browse/HARMONY-5958
> Project: Harmony
> Issue Type: Improvement
> Components: Classlib
> Affects Versions: 5.0M6
> Reporter: Regis Xu
> Assignee: Sean Qiu
> Fix For: 5.0M8
>
> Attachments: HARMONY-5958.diff
>
>
> java.sql.Date/Time/Timestamp.toString() use SimpleDateFormat and DecimalFormat to generate string format of the date, which is too slow and complex for the toString() methods.
> I re-implement them by hand, and boost the speed a lot. I will attach the patch soon.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HARMONY-5958) [classlib][sql][performance] -
improve performance of java.sql.Date/Time/Timestamp.toString()
Posted by "Sean Qiu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-5958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626400#action_12626400 ]
Sean Qiu commented on HARMONY-5958:
-----------------------------------
Here is a small test from Regis:
----------
int count = 5000;
for (int i = 0; i < count; ++i) { new Date(new
java.util.Date().getTime()).toString(); }
Date date = new Date(new java.util.Date().getTime());
long start = System.currentTimeMillis();
for (int i = 0; i < count; ++i) { date.toString(); }
long end = System.currentTimeMillis();
System.out.println("Invoke Date.toString() " + count + " times, cost:
" + (end - start));
Time time = new Time(new java.util.Date().getTime());
start = System.currentTimeMillis();
for (int i = 0; i < count; ++i) { time.toString(); }
end = System.currentTimeMillis();
System.out.println("Invoke Time.toString() " + count + " times, cost:
" + (end - start));
Timestamp timestamp = new Timestamp(new java.util.Date().getTime());
start = System.currentTimeMillis();
for (int i = 0; i < count; ++i) { timestamp.toString(); }
end = System.currentTimeMillis();
System.out.println("Invoke Timestamp.toString() " + count + " times,
cost: " + (end - start));
-------------
the first loop, give time for jvm to warm up
Below data compare the two implementations:
before the patch:
Invoke Date.toString() 5000 times, cost: 6757
Invoke Time.toString() 5000 times, cost: 7699
Invoke Timestamp.toString() 5000 times, cost: 2527
after the patch:
Invoke Date.toString() 5000 times, cost: 84
Invoke Time.toString() 5000 times, cost: 95
Invoke Timestamp.toString() 5000 times, cost: 272
> [classlib][sql][performance] - improve performance of java.sql.Date/Time/Timestamp.toString()
> ---------------------------------------------------------------------------------------------
>
> Key: HARMONY-5958
> URL: https://issues.apache.org/jira/browse/HARMONY-5958
> Project: Harmony
> Issue Type: Improvement
> Components: Classlib
> Affects Versions: 5.0M6
> Reporter: Regis Xu
> Assignee: Sean Qiu
> Fix For: 5.0M8
>
> Attachments: HARMONY-5958.diff
>
>
> java.sql.Date/Time/Timestamp.toString() use SimpleDateFormat and DecimalFormat to generate string format of the date, which is too slow and complex for the toString() methods.
> I re-implement them by hand, and boost the speed a lot. I will attach the patch soon.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.