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 2009/04/16 11:18:15 UTC
[jira] Commented: (HARMONY-6045) [classlib] [luni] Optimize
java.lang.String.toUpperCase(), String.toLowerCase() and String sharing for
more performance gains
[ https://issues.apache.org/jira/browse/HARMONY-6045?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12699595#action_12699595 ]
Regis Xu commented on HARMONY-6045:
-----------------------------------
Hi Kevin,
This patch is interesting, do you have any benchmark to prove the improvement?
> [classlib] [luni] Optimize java.lang.String.toUpperCase(), String.toLowerCase() and String sharing for more performance gains
> -----------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-6045
> URL: https://issues.apache.org/jira/browse/HARMONY-6045
> Project: Harmony
> Issue Type: Improvement
> Components: Classlib
> Affects Versions: 5.0M8
> Reporter: Kevin Zhou
> Fix For: 5.0M9
>
> Attachments: HARMONY-6045.diff
>
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> Recently, I make some improvement on java.lang.String and java.lang.AbstractStringBuilder class for more performance gains.
> 1. Move the share mode for all the AbstractStringBuilder.append method, since the append never change the share things.
> 2. Move the share mode in AbstractStringBuilder.setLength method
> 3. Add the special care for the ASCII things, especially on case things of String.toUpperCase and to LowerCase methods.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
Re: [jira] Commented: (HARMONY-6045) [classlib] [luni] Optimize
java.lang.String.toUpperCase(), String.toLowerCase() and String sharing for
more performance gains
Posted by Kevin Zhou <zh...@gmail.com>.
The content of the previous path on String.toUpperCase focuses on some
special locales.
I agree with Regis's new patch. Thanks, Regis!
On Mon, Apr 27, 2009 at 5:10 PM, Regis <xu...@gmail.com> wrote:
> Hi,
>
> I uploaded a new micro benchmark StringConvertCase.v2.java to HARMONY-6045,
> which also compare String.compareToIgnoreCase.
>
> Following are results on Linux:
>
> * Without any patches:
> String.toUpperCase
> count per cycle: 1000000
> 2681 2646 2656 2672 2666
> String.toLowerCase
> count per cycle: 1000000
> 1888 1899 1890 1855 1860
> String.compareToIgnoreCase
> count per cycle: 1000000
> 4177 3959 3958 3995 3998
>
> * Apply patch HARMONY-6045v2.diff:
> String.toUpperCase
> count per cycle: 1000000
> 5736 5699 5690 5647 5714
> String.toLowerCase
> count per cycle: 1000000
> 1145 1146 1194 1183 1146
> String.compareToIgnoreCase
> count per cycle: 1000000
> 3397 2888 2887 2888 2890
>
> It seems HARMONY-6045v2.diff cause performance degradation on
> String.toUpperCase. So I reverted String.toUpperCase, changed
> Character.toUpperCase to toUpperCase instead, and some other minor fixes
> (patch HARMONY-6045.v3.diff), I got:
>
> * Apply patch HARMONY-6045.v3.diff:
> String.toUpperCase
> count per cycle: 1000000
> 2059 2010 2052 2016 2048
> String.toLowerCase
> count per cycle: 1000000
> 1145 1185 1137 1170 1136
> String.compareToIgnoreCase
> count per cycle: 1000000
> 1785 1492 1532 1501 1542
>
> String.toUpperCase, String.toLowerCase and String.compareToIgnoreCase all
> got improvement, so I proposal to apply HARMONY-6045.v3.diff first. It seems
> HARMONY-6045v2.diff contains code to deal with specific locale "az", I hope
> some experts in this area may give some advices.
>
>
> Regis wrote:
>
>> I found at String:619, it should be
>> return codePoint - ('a' - 'A');
>>
>> and at String:595, it should be
>> return (char) (ch + ('a' - 'A'));
>>
>> Is it right? And for private char compareValue, could we return directly
>> if it's ASCII lower case, like:
>> private char compareValue(char ch) {
>> if (ch < 128) {
>> if ('A' <= ch && ch <= 'Z') {
>> return (char) (ch + ('a' - 'A'));
>> }
>> return ch;
>> }
>> return Character.toLowerCase(Character.toUpperCase(ch));
>> }
>>
>> Regis wrote:
>>
>>> Kevin Zhou wrote:
>>>
>>>> It looks good! :)
>>>>
>>>
>>> Not so good, it cause test failures. seems most of them are failed in
>>> compareToIgnoreCase and toUpperCase. Would you please take a look at it?
>>>
>>>
>>>> On Mon, Apr 20, 2009 at 1:53 PM, Regis <xu...@gmail.com> wrote:
>>>>
>>>> Regis wrote:
>>>>>
>>>>> Kevin Zhou wrote:
>>>>>>
>>>>>> Previously, it is proved by using benchmarks like Specjbb.
>>>>>>> Since it's been a long time I don't really remember the accurate
>>>>>>> statistics
>>>>>>> of how much improvements it brings.
>>>>>>>
>>>>>>> All right, I will try to write some micro benchmarks :)
>>>>>>
>>>>>> I have attached a very simple micro benchmark for converting case of
>>>>> ASCII
>>>>> character. The patch seems great:
>>>>>
>>>>> * before the patch HARMONY-6045v2.diff:
>>>>> String.toUpperCase
>>>>> count per cycle: 1000000
>>>>> 2779 2727 2706 2768 2745
>>>>> String.toLowerCase
>>>>> count per cycle: 1000000
>>>>> 1929 1934 1940 1963 1911
>>>>>
>>>>> * after the patch:
>>>>> String.toUpperCase
>>>>> count per cycle: 1000000
>>>>> 1380 1350 1355 1359 1423
>>>>> String.toLowerCase
>>>>> count per cycle: 1000000
>>>>> 1182 1189 1189 1177 1171
>>>>>
>>>>> * RI 1.5:
>>>>> String.toUpperCase
>>>>> count per cycle: 1000000
>>>>> 3123 3181 3132 3117 3156
>>>>> String.toLowerCase
>>>>> count per cycle: 1000000
>>>>> 3375 3328 3394 3336 3390
>>>>>
>>>>> for String.toUpperCase, average from 2745 to 1373.4, improve almost
>>>>> 100%
>>>>> for String.toLowerCase, average from 1935.4 to 1181.6, improve 64%
>>>>>
>>>>> But I noticed there are tests failed after patch:
>>>>> org.apache.harmony.luni.tests.java.lang.Character_UnicodeBlockTest
>>>>> org.apache.harmony.luni.tests.java.lang.String2Test
>>>>>
>>>>> org.apache.harmony.luni.tests.internal.net.www.protocol.file.FileURLConnectionTest
>>>>>
>>>>> org.apache.harmony.luni.tests.java.util.Arrays2Test
>>>>> org.apache.harmony.luni.tests.java.net.URITest
>>>>> org.apache.harmony.luni.tests.java.net.URLConnectionTest
>>>>>
>>>>>
>>>>> --
>>>>> Best Regards,
>>>>> Regis.
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>>
>
> --
> Best Regards,
> Regis.
>
Re: [jira] Commented: (HARMONY-6045) [classlib] [luni] Optimize
java.lang.String.toUpperCase(), String.toLowerCase() and String sharing for
more performance gains
Posted by Regis <xu...@gmail.com>.
Hi,
I uploaded a new micro benchmark StringConvertCase.v2.java to HARMONY-6045,
which also compare String.compareToIgnoreCase.
Following are results on Linux:
* Without any patches:
String.toUpperCase
count per cycle: 1000000
2681 2646 2656 2672 2666
String.toLowerCase
count per cycle: 1000000
1888 1899 1890 1855 1860
String.compareToIgnoreCase
count per cycle: 1000000
4177 3959 3958 3995 3998
* Apply patch HARMONY-6045v2.diff:
String.toUpperCase
count per cycle: 1000000
5736 5699 5690 5647 5714
String.toLowerCase
count per cycle: 1000000
1145 1146 1194 1183 1146
String.compareToIgnoreCase
count per cycle: 1000000
3397 2888 2887 2888 2890
It seems HARMONY-6045v2.diff cause performance degradation on
String.toUpperCase. So I reverted String.toUpperCase, changed
Character.toUpperCase to toUpperCase instead, and some other minor fixes (patch
HARMONY-6045.v3.diff), I got:
* Apply patch HARMONY-6045.v3.diff:
String.toUpperCase
count per cycle: 1000000
2059 2010 2052 2016 2048
String.toLowerCase
count per cycle: 1000000
1145 1185 1137 1170 1136
String.compareToIgnoreCase
count per cycle: 1000000
1785 1492 1532 1501 1542
String.toUpperCase, String.toLowerCase and String.compareToIgnoreCase all got
improvement, so I proposal to apply HARMONY-6045.v3.diff first. It seems
HARMONY-6045v2.diff contains code to deal with specific locale "az", I hope some
experts in this area may give some advices.
Regis wrote:
> I found at String:619, it should be
> return codePoint - ('a' - 'A');
>
> and at String:595, it should be
> return (char) (ch + ('a' - 'A'));
>
> Is it right? And for private char compareValue, could we return directly
> if it's ASCII lower case, like:
> private char compareValue(char ch) {
> if (ch < 128) {
> if ('A' <= ch && ch <= 'Z') {
> return (char) (ch + ('a' - 'A'));
> }
> return ch;
> }
> return Character.toLowerCase(Character.toUpperCase(ch));
> }
>
> Regis wrote:
>> Kevin Zhou wrote:
>>> It looks good! :)
>>
>> Not so good, it cause test failures. seems most of them are failed in
>> compareToIgnoreCase and toUpperCase. Would you please take a look at it?
>>
>>>
>>> On Mon, Apr 20, 2009 at 1:53 PM, Regis <xu...@gmail.com> wrote:
>>>
>>>> Regis wrote:
>>>>
>>>>> Kevin Zhou wrote:
>>>>>
>>>>>> Previously, it is proved by using benchmarks like Specjbb.
>>>>>> Since it's been a long time I don't really remember the accurate
>>>>>> statistics
>>>>>> of how much improvements it brings.
>>>>>>
>>>>> All right, I will try to write some micro benchmarks :)
>>>>>
>>>> I have attached a very simple micro benchmark for converting case of
>>>> ASCII
>>>> character. The patch seems great:
>>>>
>>>> * before the patch HARMONY-6045v2.diff:
>>>> String.toUpperCase
>>>> count per cycle: 1000000
>>>> 2779 2727 2706 2768 2745
>>>> String.toLowerCase
>>>> count per cycle: 1000000
>>>> 1929 1934 1940 1963 1911
>>>>
>>>> * after the patch:
>>>> String.toUpperCase
>>>> count per cycle: 1000000
>>>> 1380 1350 1355 1359 1423
>>>> String.toLowerCase
>>>> count per cycle: 1000000
>>>> 1182 1189 1189 1177 1171
>>>>
>>>> * RI 1.5:
>>>> String.toUpperCase
>>>> count per cycle: 1000000
>>>> 3123 3181 3132 3117 3156
>>>> String.toLowerCase
>>>> count per cycle: 1000000
>>>> 3375 3328 3394 3336 3390
>>>>
>>>> for String.toUpperCase, average from 2745 to 1373.4, improve almost
>>>> 100%
>>>> for String.toLowerCase, average from 1935.4 to 1181.6, improve 64%
>>>>
>>>> But I noticed there are tests failed after patch:
>>>> org.apache.harmony.luni.tests.java.lang.Character_UnicodeBlockTest
>>>> org.apache.harmony.luni.tests.java.lang.String2Test
>>>>
>>>> org.apache.harmony.luni.tests.internal.net.www.protocol.file.FileURLConnectionTest
>>>>
>>>> org.apache.harmony.luni.tests.java.util.Arrays2Test
>>>> org.apache.harmony.luni.tests.java.net.URITest
>>>> org.apache.harmony.luni.tests.java.net.URLConnectionTest
>>>>
>>>>
>>>> --
>>>> Best Regards,
>>>> Regis.
>>>>
>>>
>>
>>
>
>
--
Best Regards,
Regis.
Re: [jira] Commented: (HARMONY-6045) [classlib] [luni] Optimize
java.lang.String.toUpperCase(), String.toLowerCase() and String sharing for
more performance gains
Posted by Regis <xu...@gmail.com>.
I found at String:619, it should be
return codePoint - ('a' - 'A');
and at String:595, it should be
return (char) (ch + ('a' - 'A'));
Is it right? And for private char compareValue, could we return directly if it's
ASCII lower case, like:
private char compareValue(char ch) {
if (ch < 128) {
if ('A' <= ch && ch <= 'Z') {
return (char) (ch + ('a' - 'A'));
}
return ch;
}
return Character.toLowerCase(Character.toUpperCase(ch));
}
Regis wrote:
> Kevin Zhou wrote:
>> It looks good! :)
>
> Not so good, it cause test failures. seems most of them are failed in
> compareToIgnoreCase and toUpperCase. Would you please take a look at it?
>
>>
>> On Mon, Apr 20, 2009 at 1:53 PM, Regis <xu...@gmail.com> wrote:
>>
>>> Regis wrote:
>>>
>>>> Kevin Zhou wrote:
>>>>
>>>>> Previously, it is proved by using benchmarks like Specjbb.
>>>>> Since it's been a long time I don't really remember the accurate
>>>>> statistics
>>>>> of how much improvements it brings.
>>>>>
>>>> All right, I will try to write some micro benchmarks :)
>>>>
>>> I have attached a very simple micro benchmark for converting case of
>>> ASCII
>>> character. The patch seems great:
>>>
>>> * before the patch HARMONY-6045v2.diff:
>>> String.toUpperCase
>>> count per cycle: 1000000
>>> 2779 2727 2706 2768 2745
>>> String.toLowerCase
>>> count per cycle: 1000000
>>> 1929 1934 1940 1963 1911
>>>
>>> * after the patch:
>>> String.toUpperCase
>>> count per cycle: 1000000
>>> 1380 1350 1355 1359 1423
>>> String.toLowerCase
>>> count per cycle: 1000000
>>> 1182 1189 1189 1177 1171
>>>
>>> * RI 1.5:
>>> String.toUpperCase
>>> count per cycle: 1000000
>>> 3123 3181 3132 3117 3156
>>> String.toLowerCase
>>> count per cycle: 1000000
>>> 3375 3328 3394 3336 3390
>>>
>>> for String.toUpperCase, average from 2745 to 1373.4, improve almost 100%
>>> for String.toLowerCase, average from 1935.4 to 1181.6, improve 64%
>>>
>>> But I noticed there are tests failed after patch:
>>> org.apache.harmony.luni.tests.java.lang.Character_UnicodeBlockTest
>>> org.apache.harmony.luni.tests.java.lang.String2Test
>>>
>>> org.apache.harmony.luni.tests.internal.net.www.protocol.file.FileURLConnectionTest
>>>
>>> org.apache.harmony.luni.tests.java.util.Arrays2Test
>>> org.apache.harmony.luni.tests.java.net.URITest
>>> org.apache.harmony.luni.tests.java.net.URLConnectionTest
>>>
>>>
>>> --
>>> Best Regards,
>>> Regis.
>>>
>>
>
>
--
Best Regards,
Regis.
Re: [jira] Commented: (HARMONY-6045) [classlib] [luni] Optimize
java.lang.String.toUpperCase(), String.toLowerCase() and String sharing for
more performance gains
Posted by Regis <xu...@gmail.com>.
Kevin Zhou wrote:
> It looks good! :)
Not so good, it cause test failures. seems most of them are failed in
compareToIgnoreCase and toUpperCase. Would you please take a look at it?
>
> On Mon, Apr 20, 2009 at 1:53 PM, Regis <xu...@gmail.com> wrote:
>
>> Regis wrote:
>>
>>> Kevin Zhou wrote:
>>>
>>>> Previously, it is proved by using benchmarks like Specjbb.
>>>> Since it's been a long time I don't really remember the accurate
>>>> statistics
>>>> of how much improvements it brings.
>>>>
>>> All right, I will try to write some micro benchmarks :)
>>>
>> I have attached a very simple micro benchmark for converting case of ASCII
>> character. The patch seems great:
>>
>> * before the patch HARMONY-6045v2.diff:
>> String.toUpperCase
>> count per cycle: 1000000
>> 2779 2727 2706 2768 2745
>> String.toLowerCase
>> count per cycle: 1000000
>> 1929 1934 1940 1963 1911
>>
>> * after the patch:
>> String.toUpperCase
>> count per cycle: 1000000
>> 1380 1350 1355 1359 1423
>> String.toLowerCase
>> count per cycle: 1000000
>> 1182 1189 1189 1177 1171
>>
>> * RI 1.5:
>> String.toUpperCase
>> count per cycle: 1000000
>> 3123 3181 3132 3117 3156
>> String.toLowerCase
>> count per cycle: 1000000
>> 3375 3328 3394 3336 3390
>>
>> for String.toUpperCase, average from 2745 to 1373.4, improve almost 100%
>> for String.toLowerCase, average from 1935.4 to 1181.6, improve 64%
>>
>> But I noticed there are tests failed after patch:
>> org.apache.harmony.luni.tests.java.lang.Character_UnicodeBlockTest
>> org.apache.harmony.luni.tests.java.lang.String2Test
>>
>> org.apache.harmony.luni.tests.internal.net.www.protocol.file.FileURLConnectionTest
>> org.apache.harmony.luni.tests.java.util.Arrays2Test
>> org.apache.harmony.luni.tests.java.net.URITest
>> org.apache.harmony.luni.tests.java.net.URLConnectionTest
>>
>>
>> --
>> Best Regards,
>> Regis.
>>
>
--
Best Regards,
Regis.
Re: [jira] Commented: (HARMONY-6045) [classlib] [luni] Optimize
java.lang.String.toUpperCase(), String.toLowerCase() and String sharing for
more performance gains
Posted by Kevin Zhou <zh...@gmail.com>.
It looks good! :)
On Mon, Apr 20, 2009 at 1:53 PM, Regis <xu...@gmail.com> wrote:
> Regis wrote:
>
>> Kevin Zhou wrote:
>>
>>> Previously, it is proved by using benchmarks like Specjbb.
>>> Since it's been a long time I don't really remember the accurate
>>> statistics
>>> of how much improvements it brings.
>>>
>> All right, I will try to write some micro benchmarks :)
>>
>
> I have attached a very simple micro benchmark for converting case of ASCII
> character. The patch seems great:
>
> * before the patch HARMONY-6045v2.diff:
> String.toUpperCase
> count per cycle: 1000000
> 2779 2727 2706 2768 2745
> String.toLowerCase
> count per cycle: 1000000
> 1929 1934 1940 1963 1911
>
> * after the patch:
> String.toUpperCase
> count per cycle: 1000000
> 1380 1350 1355 1359 1423
> String.toLowerCase
> count per cycle: 1000000
> 1182 1189 1189 1177 1171
>
> * RI 1.5:
> String.toUpperCase
> count per cycle: 1000000
> 3123 3181 3132 3117 3156
> String.toLowerCase
> count per cycle: 1000000
> 3375 3328 3394 3336 3390
>
> for String.toUpperCase, average from 2745 to 1373.4, improve almost 100%
> for String.toLowerCase, average from 1935.4 to 1181.6, improve 64%
>
> But I noticed there are tests failed after patch:
> org.apache.harmony.luni.tests.java.lang.Character_UnicodeBlockTest
> org.apache.harmony.luni.tests.java.lang.String2Test
>
> org.apache.harmony.luni.tests.internal.net.www.protocol.file.FileURLConnectionTest
> org.apache.harmony.luni.tests.java.util.Arrays2Test
> org.apache.harmony.luni.tests.java.net.URITest
> org.apache.harmony.luni.tests.java.net.URLConnectionTest
>
>
> --
> Best Regards,
> Regis.
>
Re: [jira] Commented: (HARMONY-6045) [classlib] [luni] Optimize
java.lang.String.toUpperCase(), String.toLowerCase() and String sharing for
more performance gains
Posted by Regis <xu...@gmail.com>.
Regis wrote:
> Kevin Zhou wrote:
>> Previously, it is proved by using benchmarks like Specjbb.
>> Since it's been a long time I don't really remember the accurate
>> statistics
>> of how much improvements it brings.
> All right, I will try to write some micro benchmarks :)
I have attached a very simple micro benchmark for converting case of ASCII
character. The patch seems great:
* before the patch HARMONY-6045v2.diff:
String.toUpperCase
count per cycle: 1000000
2779 2727 2706 2768 2745
String.toLowerCase
count per cycle: 1000000
1929 1934 1940 1963 1911
* after the patch:
String.toUpperCase
count per cycle: 1000000
1380 1350 1355 1359 1423
String.toLowerCase
count per cycle: 1000000
1182 1189 1189 1177 1171
* RI 1.5:
String.toUpperCase
count per cycle: 1000000
3123 3181 3132 3117 3156
String.toLowerCase
count per cycle: 1000000
3375 3328 3394 3336 3390
for String.toUpperCase, average from 2745 to 1373.4, improve almost 100%
for String.toLowerCase, average from 1935.4 to 1181.6, improve 64%
But I noticed there are tests failed after patch:
org.apache.harmony.luni.tests.java.lang.Character_UnicodeBlockTest
org.apache.harmony.luni.tests.java.lang.String2Test
org.apache.harmony.luni.tests.internal.net.www.protocol.file.FileURLConnectionTest
org.apache.harmony.luni.tests.java.util.Arrays2Test
org.apache.harmony.luni.tests.java.net.URITest
org.apache.harmony.luni.tests.java.net.URLConnectionTest
--
Best Regards,
Regis.
Re: [jira] Commented: (HARMONY-6045) [classlib] [luni] Optimize
java.lang.String.toUpperCase(), String.toLowerCase() and String sharing for
more performance gains
Posted by Kevin Zhou <zh...@gmail.com>.
Thanks, Regis.
On Thu, Apr 16, 2009 at 5:49 PM, Regis <xu...@gmail.com> wrote:
> Kevin Zhou wrote:
>
>> Previously, it is proved by using benchmarks like Specjbb.
>> Since it's been a long time I don't really remember the accurate
>> statistics
>> of how much improvements it brings.
>>
> All right, I will try to write some micro benchmarks :)
>
>
>> On Thu, Apr 16, 2009 at 5:18 PM, Regis Xu (JIRA) <ji...@apache.org> wrote:
>>
>> [
>>>
>>> https://issues.apache.org/jira/browse/HARMONY-6045?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12699595#action_12699595
>>> ]
>>>
>>> Regis Xu commented on HARMONY-6045:
>>> -----------------------------------
>>>
>>> Hi Kevin,
>>>
>>> This patch is interesting, do you have any benchmark to prove the
>>> improvement?
>>>
>>> [classlib] [luni] Optimize java.lang.String.toUpperCase(),
>>>>
>>> String.toLowerCase() and String sharing for more performance gains
>>>
>>> -----------------------------------------------------------------------------------------------------------------------------
>>>
>>>> Key: HARMONY-6045
>>>> URL: https://issues.apache.org/jira/browse/HARMONY-6045
>>>> Project: Harmony
>>>> Issue Type: Improvement
>>>> Components: Classlib
>>>> Affects Versions: 5.0M8
>>>> Reporter: Kevin Zhou
>>>> Fix For: 5.0M9
>>>>
>>>> Attachments: HARMONY-6045.diff
>>>>
>>>> Original Estimate: 24h
>>>> Remaining Estimate: 24h
>>>>
>>>> Recently, I make some improvement on java.lang.String and
>>>>
>>> java.lang.AbstractStringBuilder class for more performance gains.
>>>
>>>> 1. Move the share mode for all the AbstractStringBuilder.append method,
>>>>
>>> since the append never change the share things.
>>>
>>>> 2. Move the share mode in AbstractStringBuilder.setLength method
>>>> 3. Add the special care for the ASCII things, especially on case things
>>>>
>>> of String.toUpperCase and to LowerCase methods.
>>>
>>> --
>>> This message is automatically generated by JIRA.
>>> -
>>> You can reply to this email to add a comment to the issue online.
>>>
>>>
>>>
>>
>
> --
> Best Regards,
> Regis.
>
Re: [jira] Commented: (HARMONY-6045) [classlib] [luni] Optimize
java.lang.String.toUpperCase(), String.toLowerCase() and String sharing for
more performance gains
Posted by Regis <xu...@gmail.com>.
Kevin Zhou wrote:
> Previously, it is proved by using benchmarks like Specjbb.
> Since it's been a long time I don't really remember the accurate statistics
> of how much improvements it brings.
All right, I will try to write some micro benchmarks :)
>
> On Thu, Apr 16, 2009 at 5:18 PM, Regis Xu (JIRA) <ji...@apache.org> wrote:
>
>> [
>> https://issues.apache.org/jira/browse/HARMONY-6045?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12699595#action_12699595]
>>
>> Regis Xu commented on HARMONY-6045:
>> -----------------------------------
>>
>> Hi Kevin,
>>
>> This patch is interesting, do you have any benchmark to prove the
>> improvement?
>>
>>> [classlib] [luni] Optimize java.lang.String.toUpperCase(),
>> String.toLowerCase() and String sharing for more performance gains
>> -----------------------------------------------------------------------------------------------------------------------------
>>> Key: HARMONY-6045
>>> URL: https://issues.apache.org/jira/browse/HARMONY-6045
>>> Project: Harmony
>>> Issue Type: Improvement
>>> Components: Classlib
>>> Affects Versions: 5.0M8
>>> Reporter: Kevin Zhou
>>> Fix For: 5.0M9
>>>
>>> Attachments: HARMONY-6045.diff
>>>
>>> Original Estimate: 24h
>>> Remaining Estimate: 24h
>>>
>>> Recently, I make some improvement on java.lang.String and
>> java.lang.AbstractStringBuilder class for more performance gains.
>>> 1. Move the share mode for all the AbstractStringBuilder.append method,
>> since the append never change the share things.
>>> 2. Move the share mode in AbstractStringBuilder.setLength method
>>> 3. Add the special care for the ASCII things, especially on case things
>> of String.toUpperCase and to LowerCase methods.
>>
>> --
>> This message is automatically generated by JIRA.
>> -
>> You can reply to this email to add a comment to the issue online.
>>
>>
>
--
Best Regards,
Regis.
Re: [jira] Commented: (HARMONY-6045) [classlib] [luni] Optimize
java.lang.String.toUpperCase(), String.toLowerCase() and String sharing for
more performance gains
Posted by Kevin Zhou <zh...@gmail.com>.
Previously, it is proved by using benchmarks like Specjbb.
Since it's been a long time I don't really remember the accurate statistics
of how much improvements it brings.
On Thu, Apr 16, 2009 at 5:18 PM, Regis Xu (JIRA) <ji...@apache.org> wrote:
>
> [
> https://issues.apache.org/jira/browse/HARMONY-6045?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12699595#action_12699595]
>
> Regis Xu commented on HARMONY-6045:
> -----------------------------------
>
> Hi Kevin,
>
> This patch is interesting, do you have any benchmark to prove the
> improvement?
>
> > [classlib] [luni] Optimize java.lang.String.toUpperCase(),
> String.toLowerCase() and String sharing for more performance gains
> >
> -----------------------------------------------------------------------------------------------------------------------------
> >
> > Key: HARMONY-6045
> > URL: https://issues.apache.org/jira/browse/HARMONY-6045
> > Project: Harmony
> > Issue Type: Improvement
> > Components: Classlib
> > Affects Versions: 5.0M8
> > Reporter: Kevin Zhou
> > Fix For: 5.0M9
> >
> > Attachments: HARMONY-6045.diff
> >
> > Original Estimate: 24h
> > Remaining Estimate: 24h
> >
> > Recently, I make some improvement on java.lang.String and
> java.lang.AbstractStringBuilder class for more performance gains.
> > 1. Move the share mode for all the AbstractStringBuilder.append method,
> since the append never change the share things.
> > 2. Move the share mode in AbstractStringBuilder.setLength method
> > 3. Add the special care for the ASCII things, especially on case things
> of String.toUpperCase and to LowerCase methods.
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>