You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Jim Yu (JIRA)" <ji...@apache.org> on 2009/01/08 10:01:03 UTC

[jira] Created: (HARMONY-6068) [java6][luni] Improve Integer.toString(int) performance

[java6][luni] Improve Integer.toString(int) performance
-------------------------------------------------------

                 Key: HARMONY-6068
                 URL: https://issues.apache.org/jira/browse/HARMONY-6068
             Project: Harmony
          Issue Type: Improvement
          Components: Classlib
    Affects Versions: 5.0M8
            Reporter: Jim Yu
             Fix For: 5.0M9


I very agree with Aleksey Shipilev' comment [1] for JIRA HARMONY-6056 as following, so I implement an optimized algorithm for  Integer.toString(int) method. Thanks to Aleksey Shipilev's benchmark,  here are the test results[2] on my windows platform.
[1] "Ok, we can implement the in-place Integer.toString() and specialize
the radix-10 conversion in Integer. Then Classlib performance guys
might use the inplace conversion to optimize StringBuilder performance
or even catch the concatenation like J9 does.
My idea is to share whatever optimization between all VMs that use the Classlib."
[2] 
Result for Harmony java6 branch:
(String)base + (int)add:
-------------------------------------------
 base length (vars with rows): 0..2..10
  add length (vars with cols): 0..2..10

 loop duration = 100 msecs
 target variance = 0.05

ops/msec, the more the better:
6721, 6096, *4650, *3846, *3178,
*8080, *5833, *4447, 3731, 3048,
*7985, *5848, 4788, 3727, *3114,
*7891, 5592, *4389, *3560, 3048,
8388, 5607, *4522, 3727, 3051,

After applied my patch:
(String)base + (int)add:
-------------------------------------------
 base length (vars with rows): 0..2..10
  add length (vars with cols): 0..2..10

 loop duration = 100 msecs
 target variance = 0.05

ops/msec, the more the better:
8322, 6721, 4791, 4788, 4788,
8388, 6721, 5156, *5012, 4797,
8388, 6707, 5161, *4963, 4795,
8388, 6707, *5126, 4802, 4788,
*8048, 6700, *5021, 4802, *4687,



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6068) [luni] Improve Integer.toString(int) performance

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662300#action_12662300 ] 

Tim Ellison commented on HARMONY-6068:
--------------------------------------

Forgot to mention the patch was applied at repo revision r732988.


> [luni] Improve Integer.toString(int) performance
> ------------------------------------------------
>
>                 Key: HARMONY-6068
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6068
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Jim Yu
>            Assignee: Tim Ellison
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6068-final-V2.diff, HARMONY-6068-final.diff, HARMONY-6068-merged-v1.diff, HARMONY-6068-merged-v2.diff, HARMONY-6068.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I very agree with Aleksey Shipilev' comment [1] for JIRA HARMONY-6056 as following, so I implement an optimized algorithm for  Integer.toString(int) method. Thanks to Aleksey Shipilev's benchmark,  here are the test results[2] on my windows platform.
> [1] "Ok, we can implement the in-place Integer.toString() and specialize
> the radix-10 conversion in Integer. Then Classlib performance guys
> might use the inplace conversion to optimize StringBuilder performance
> or even catch the concatenation like J9 does.
> My idea is to share whatever optimization between all VMs that use the Classlib."
> [2] 
> Result for Harmony java6 branch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 6721, 6096, *4650, *3846, *3178,
> *8080, *5833, *4447, 3731, 3048,
> *7985, *5848, 4788, 3727, *3114,
> *7891, 5592, *4389, *3560, 3048,
> 8388, 5607, *4522, 3727, 3051,
> After applied my patch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 8322, 6721, 4791, 4788, 4788,
> 8388, 6721, 5156, *5012, 4797,
> 8388, 6707, 5161, *4963, 4795,
> 8388, 6707, *5126, 4802, 4788,
> *8048, 6700, *5021, 4802, *4687,

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HARMONY-6068) [luni] Improve Integer.toString(int) performance

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

Tim Ellison reassigned HARMONY-6068:
------------------------------------

    Assignee: Tim Ellison

> [luni] Improve Integer.toString(int) performance
> ------------------------------------------------
>
>                 Key: HARMONY-6068
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6068
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Jim Yu
>            Assignee: Tim Ellison
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6068-final.diff, HARMONY-6068-merged-v1.diff, HARMONY-6068-merged-v2.diff, HARMONY-6068.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I very agree with Aleksey Shipilev' comment [1] for JIRA HARMONY-6056 as following, so I implement an optimized algorithm for  Integer.toString(int) method. Thanks to Aleksey Shipilev's benchmark,  here are the test results[2] on my windows platform.
> [1] "Ok, we can implement the in-place Integer.toString() and specialize
> the radix-10 conversion in Integer. Then Classlib performance guys
> might use the inplace conversion to optimize StringBuilder performance
> or even catch the concatenation like J9 does.
> My idea is to share whatever optimization between all VMs that use the Classlib."
> [2] 
> Result for Harmony java6 branch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 6721, 6096, *4650, *3846, *3178,
> *8080, *5833, *4447, 3731, 3048,
> *7985, *5848, 4788, 3727, *3114,
> *7891, 5592, *4389, *3560, 3048,
> 8388, 5607, *4522, 3727, 3051,
> After applied my patch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 8322, 6721, 4791, 4788, 4788,
> 8388, 6721, 5156, *5012, 4797,
> 8388, 6707, 5161, *4963, 4795,
> 8388, 6707, *5126, 4802, 4788,
> *8048, 6700, *5021, 4802, *4687,

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6068) [java6][luni] Improve Integer.toString(int) performance

Posted by "Nathan Beyer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662234#action_12662234 ] 

Nathan Beyer commented on HARMONY-6068:
---------------------------------------

Is this for the Java 6 branch only or the is subject wrong?

> [java6][luni] Improve Integer.toString(int) performance
> -------------------------------------------------------
>
>                 Key: HARMONY-6068
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6068
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Jim Yu
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6068-final.diff, HARMONY-6068-merged-v1.diff, HARMONY-6068-merged-v2.diff, HARMONY-6068.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I very agree with Aleksey Shipilev' comment [1] for JIRA HARMONY-6056 as following, so I implement an optimized algorithm for  Integer.toString(int) method. Thanks to Aleksey Shipilev's benchmark,  here are the test results[2] on my windows platform.
> [1] "Ok, we can implement the in-place Integer.toString() and specialize
> the radix-10 conversion in Integer. Then Classlib performance guys
> might use the inplace conversion to optimize StringBuilder performance
> or even catch the concatenation like J9 does.
> My idea is to share whatever optimization between all VMs that use the Classlib."
> [2] 
> Result for Harmony java6 branch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 6721, 6096, *4650, *3846, *3178,
> *8080, *5833, *4447, 3731, 3048,
> *7985, *5848, 4788, 3727, *3114,
> *7891, 5592, *4389, *3560, 3048,
> 8388, 5607, *4522, 3727, 3051,
> After applied my patch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 8322, 6721, 4791, 4788, 4788,
> 8388, 6721, 5156, *5012, 4797,
> 8388, 6707, 5161, *4963, 4795,
> 8388, 6707, *5126, 4802, 4788,
> *8048, 6700, *5021, 4802, *4687,

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6068) [java6][luni] Improve Integer.toString(int) performance

Posted by "Jim Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662239#action_12662239 ] 

Jim Yu commented on HARMONY-6068:
---------------------------------

Hi Nathan,
This patch is for both trunk and Java 6 branch.

> [java6][luni] Improve Integer.toString(int) performance
> -------------------------------------------------------
>
>                 Key: HARMONY-6068
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6068
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Jim Yu
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6068-final.diff, HARMONY-6068-merged-v1.diff, HARMONY-6068-merged-v2.diff, HARMONY-6068.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I very agree with Aleksey Shipilev' comment [1] for JIRA HARMONY-6056 as following, so I implement an optimized algorithm for  Integer.toString(int) method. Thanks to Aleksey Shipilev's benchmark,  here are the test results[2] on my windows platform.
> [1] "Ok, we can implement the in-place Integer.toString() and specialize
> the radix-10 conversion in Integer. Then Classlib performance guys
> might use the inplace conversion to optimize StringBuilder performance
> or even catch the concatenation like J9 does.
> My idea is to share whatever optimization between all VMs that use the Classlib."
> [2] 
> Result for Harmony java6 branch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 6721, 6096, *4650, *3846, *3178,
> *8080, *5833, *4447, 3731, 3048,
> *7985, *5848, 4788, 3727, *3114,
> *7891, 5592, *4389, *3560, 3048,
> 8388, 5607, *4522, 3727, 3051,
> After applied my patch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 8322, 6721, 4791, 4788, 4788,
> 8388, 6721, 5156, *5012, 4797,
> 8388, 6707, 5161, *4963, 4795,
> 8388, 6707, *5126, 4802, 4788,
> *8048, 6700, *5021, 4802, *4687,

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-6068) [java6][luni] Improve Integer.toString(int) performance

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

Aleksey Shipilev updated HARMONY-6068:
--------------------------------------

    Attachment: HARMONY-6068-merged-v1.diff

HARMONY-6068-merged-v1.diff

Merged implementations from this issue, Kevin's from HARMONY-6056, and mine (a bit hacked Kevin's one).

> [java6][luni] Improve Integer.toString(int) performance
> -------------------------------------------------------
>
>                 Key: HARMONY-6068
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6068
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Jim Yu
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6068-merged-v1.diff, HARMONY-6068.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I very agree with Aleksey Shipilev' comment [1] for JIRA HARMONY-6056 as following, so I implement an optimized algorithm for  Integer.toString(int) method. Thanks to Aleksey Shipilev's benchmark,  here are the test results[2] on my windows platform.
> [1] "Ok, we can implement the in-place Integer.toString() and specialize
> the radix-10 conversion in Integer. Then Classlib performance guys
> might use the inplace conversion to optimize StringBuilder performance
> or even catch the concatenation like J9 does.
> My idea is to share whatever optimization between all VMs that use the Classlib."
> [2] 
> Result for Harmony java6 branch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 6721, 6096, *4650, *3846, *3178,
> *8080, *5833, *4447, 3731, 3048,
> *7985, *5848, 4788, 3727, *3114,
> *7891, 5592, *4389, *3560, 3048,
> 8388, 5607, *4522, 3727, 3051,
> After applied my patch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 8322, 6721, 4791, 4788, 4788,
> 8388, 6721, 5156, *5012, 4797,
> 8388, 6707, 5161, *4963, 4795,
> 8388, 6707, *5126, 4802, 4788,
> *8048, 6700, *5021, 4802, *4687,

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-6068) [java6][luni] Improve Integer.toString(int) performance

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

Aleksey Shipilev updated HARMONY-6068:
--------------------------------------

    Attachment: HARMONY-6068-merged-v2.diff

HARMONY-6068-merged-v2.diff
Updated.

> [java6][luni] Improve Integer.toString(int) performance
> -------------------------------------------------------
>
>                 Key: HARMONY-6068
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6068
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Jim Yu
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6068-merged-v1.diff, HARMONY-6068-merged-v2.diff, HARMONY-6068.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I very agree with Aleksey Shipilev' comment [1] for JIRA HARMONY-6056 as following, so I implement an optimized algorithm for  Integer.toString(int) method. Thanks to Aleksey Shipilev's benchmark,  here are the test results[2] on my windows platform.
> [1] "Ok, we can implement the in-place Integer.toString() and specialize
> the radix-10 conversion in Integer. Then Classlib performance guys
> might use the inplace conversion to optimize StringBuilder performance
> or even catch the concatenation like J9 does.
> My idea is to share whatever optimization between all VMs that use the Classlib."
> [2] 
> Result for Harmony java6 branch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 6721, 6096, *4650, *3846, *3178,
> *8080, *5833, *4447, 3731, 3048,
> *7985, *5848, 4788, 3727, *3114,
> *7891, 5592, *4389, *3560, 3048,
> 8388, 5607, *4522, 3727, 3051,
> After applied my patch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 8322, 6721, 4791, 4788, 4788,
> 8388, 6721, 5156, *5012, 4797,
> 8388, 6707, 5161, *4963, 4795,
> 8388, 6707, *5126, 4802, 4788,
> *8048, 6700, *5021, 4802, *4687,

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6068) [luni] Improve Integer.toString(int) performance

Posted by "Jim Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662299#action_12662299 ] 

Jim Yu commented on HARMONY-6068:
---------------------------------

Sorry for bringing formatting changes, I've attached a new one : )

> [luni] Improve Integer.toString(int) performance
> ------------------------------------------------
>
>                 Key: HARMONY-6068
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6068
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Jim Yu
>            Assignee: Tim Ellison
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6068-final-V2.diff, HARMONY-6068-final.diff, HARMONY-6068-merged-v1.diff, HARMONY-6068-merged-v2.diff, HARMONY-6068.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I very agree with Aleksey Shipilev' comment [1] for JIRA HARMONY-6056 as following, so I implement an optimized algorithm for  Integer.toString(int) method. Thanks to Aleksey Shipilev's benchmark,  here are the test results[2] on my windows platform.
> [1] "Ok, we can implement the in-place Integer.toString() and specialize
> the radix-10 conversion in Integer. Then Classlib performance guys
> might use the inplace conversion to optimize StringBuilder performance
> or even catch the concatenation like J9 does.
> My idea is to share whatever optimization between all VMs that use the Classlib."
> [2] 
> Result for Harmony java6 branch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 6721, 6096, *4650, *3846, *3178,
> *8080, *5833, *4447, 3731, 3048,
> *7985, *5848, 4788, 3727, *3114,
> *7891, 5592, *4389, *3560, 3048,
> 8388, 5607, *4522, 3727, 3051,
> After applied my patch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 8322, 6721, 4791, 4788, 4788,
> 8388, 6721, 5156, *5012, 4797,
> 8388, 6707, 5161, *4963, 4795,
> 8388, 6707, *5126, 4802, 4788,
> *8048, 6700, *5021, 4802, *4687,

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-6068) [java6][luni] Improve Integer.toString(int) performance

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

Jim Yu updated HARMONY-6068:
----------------------------

    Attachment: HARMONY-6068.diff

> [java6][luni] Improve Integer.toString(int) performance
> -------------------------------------------------------
>
>                 Key: HARMONY-6068
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6068
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Jim Yu
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6068.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I very agree with Aleksey Shipilev' comment [1] for JIRA HARMONY-6056 as following, so I implement an optimized algorithm for  Integer.toString(int) method. Thanks to Aleksey Shipilev's benchmark,  here are the test results[2] on my windows platform.
> [1] "Ok, we can implement the in-place Integer.toString() and specialize
> the radix-10 conversion in Integer. Then Classlib performance guys
> might use the inplace conversion to optimize StringBuilder performance
> or even catch the concatenation like J9 does.
> My idea is to share whatever optimization between all VMs that use the Classlib."
> [2] 
> Result for Harmony java6 branch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 6721, 6096, *4650, *3846, *3178,
> *8080, *5833, *4447, 3731, 3048,
> *7985, *5848, 4788, 3727, *3114,
> *7891, 5592, *4389, *3560, 3048,
> 8388, 5607, *4522, 3727, 3051,
> After applied my patch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 8322, 6721, 4791, 4788, 4788,
> 8388, 6721, 5156, *5012, 4797,
> 8388, 6707, 5161, *4963, 4795,
> 8388, 6707, *5126, 4802, 4788,
> *8048, 6700, *5021, 4802, *4687,

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-6068) [luni] Improve Integer.toString(int) performance

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

Tim Ellison resolved HARMONY-6068.
----------------------------------

    Resolution: Fixed

Thanks to all who worked on this.

I applied the final patch with minor changes:
 - removed the new lines
 - renamed 'numbers' array to 'decimalScale'
 - added a couple of comments, more would be good

Anybody write functional tests that ensure the boundary cases of the algorithm are working correctly?


> [luni] Improve Integer.toString(int) performance
> ------------------------------------------------
>
>                 Key: HARMONY-6068
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6068
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Jim Yu
>            Assignee: Tim Ellison
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6068-final-V2.diff, HARMONY-6068-final.diff, HARMONY-6068-merged-v1.diff, HARMONY-6068-merged-v2.diff, HARMONY-6068.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I very agree with Aleksey Shipilev' comment [1] for JIRA HARMONY-6056 as following, so I implement an optimized algorithm for  Integer.toString(int) method. Thanks to Aleksey Shipilev's benchmark,  here are the test results[2] on my windows platform.
> [1] "Ok, we can implement the in-place Integer.toString() and specialize
> the radix-10 conversion in Integer. Then Classlib performance guys
> might use the inplace conversion to optimize StringBuilder performance
> or even catch the concatenation like J9 does.
> My idea is to share whatever optimization between all VMs that use the Classlib."
> [2] 
> Result for Harmony java6 branch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 6721, 6096, *4650, *3846, *3178,
> *8080, *5833, *4447, 3731, 3048,
> *7985, *5848, 4788, 3727, *3114,
> *7891, 5592, *4389, *3560, 3048,
> 8388, 5607, *4522, 3727, 3051,
> After applied my patch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 8322, 6721, 4791, 4788, 4788,
> 8388, 6721, 5156, *5012, 4797,
> 8388, 6707, 5161, *4963, 4795,
> 8388, 6707, *5126, 4802, 4788,
> *8048, 6700, *5021, 4802, *4687,

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-6068) [java6][luni] Improve Integer.toString(int) performance

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

Jim Yu updated HARMONY-6068:
----------------------------

    Attachment: HARMONY-6068-final.diff

> [java6][luni] Improve Integer.toString(int) performance
> -------------------------------------------------------
>
>                 Key: HARMONY-6068
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6068
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Jim Yu
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6068-final.diff, HARMONY-6068-merged-v1.diff, HARMONY-6068-merged-v2.diff, HARMONY-6068.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I very agree with Aleksey Shipilev' comment [1] for JIRA HARMONY-6056 as following, so I implement an optimized algorithm for  Integer.toString(int) method. Thanks to Aleksey Shipilev's benchmark,  here are the test results[2] on my windows platform.
> [1] "Ok, we can implement the in-place Integer.toString() and specialize
> the radix-10 conversion in Integer. Then Classlib performance guys
> might use the inplace conversion to optimize StringBuilder performance
> or even catch the concatenation like J9 does.
> My idea is to share whatever optimization between all VMs that use the Classlib."
> [2] 
> Result for Harmony java6 branch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 6721, 6096, *4650, *3846, *3178,
> *8080, *5833, *4447, 3731, 3048,
> *7985, *5848, 4788, 3727, *3114,
> *7891, 5592, *4389, *3560, 3048,
> 8388, 5607, *4522, 3727, 3051,
> After applied my patch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 8322, 6721, 4791, 4788, 4788,
> 8388, 6721, 5156, *5012, 4797,
> 8388, 6707, 5161, *4963, 4795,
> 8388, 6707, *5126, 4802, 4788,
> *8048, 6700, *5021, 4802, *4687,

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-6068) [luni] Improve Integer.toString(int) performance

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

Jim Yu updated HARMONY-6068:
----------------------------

    Attachment: HARMONY-6068-testcase.diff

> [luni] Improve Integer.toString(int) performance
> ------------------------------------------------
>
>                 Key: HARMONY-6068
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6068
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Jim Yu
>            Assignee: Tim Ellison
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6068-final-V2.diff, HARMONY-6068-final.diff, HARMONY-6068-merged-v1.diff, HARMONY-6068-merged-v2.diff, HARMONY-6068-testcase.diff, HARMONY-6068.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I very agree with Aleksey Shipilev' comment [1] for JIRA HARMONY-6056 as following, so I implement an optimized algorithm for  Integer.toString(int) method. Thanks to Aleksey Shipilev's benchmark,  here are the test results[2] on my windows platform.
> [1] "Ok, we can implement the in-place Integer.toString() and specialize
> the radix-10 conversion in Integer. Then Classlib performance guys
> might use the inplace conversion to optimize StringBuilder performance
> or even catch the concatenation like J9 does.
> My idea is to share whatever optimization between all VMs that use the Classlib."
> [2] 
> Result for Harmony java6 branch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 6721, 6096, *4650, *3846, *3178,
> *8080, *5833, *4447, 3731, 3048,
> *7985, *5848, 4788, 3727, *3114,
> *7891, 5592, *4389, *3560, 3048,
> 8388, 5607, *4522, 3727, 3051,
> After applied my patch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 8322, 6721, 4791, 4788, 4788,
> 8388, 6721, 5156, *5012, 4797,
> 8388, 6707, 5161, *4963, 4795,
> 8388, 6707, *5126, 4802, 4788,
> *8048, 6700, *5021, 4802, *4687,

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6068) [luni] Improve Integer.toString(int) performance

Posted by "Jim Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662306#action_12662306 ] 

Jim Yu commented on HARMONY-6068:
---------------------------------

Thanks, Tim.  I've added more test cases for this method.

> [luni] Improve Integer.toString(int) performance
> ------------------------------------------------
>
>                 Key: HARMONY-6068
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6068
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Jim Yu
>            Assignee: Tim Ellison
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6068-final-V2.diff, HARMONY-6068-final.diff, HARMONY-6068-merged-v1.diff, HARMONY-6068-merged-v2.diff, HARMONY-6068-testcase.diff, HARMONY-6068.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I very agree with Aleksey Shipilev' comment [1] for JIRA HARMONY-6056 as following, so I implement an optimized algorithm for  Integer.toString(int) method. Thanks to Aleksey Shipilev's benchmark,  here are the test results[2] on my windows platform.
> [1] "Ok, we can implement the in-place Integer.toString() and specialize
> the radix-10 conversion in Integer. Then Classlib performance guys
> might use the inplace conversion to optimize StringBuilder performance
> or even catch the concatenation like J9 does.
> My idea is to share whatever optimization between all VMs that use the Classlib."
> [2] 
> Result for Harmony java6 branch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 6721, 6096, *4650, *3846, *3178,
> *8080, *5833, *4447, 3731, 3048,
> *7985, *5848, 4788, 3727, *3114,
> *7891, 5592, *4389, *3560, 3048,
> 8388, 5607, *4522, 3727, 3051,
> After applied my patch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 8322, 6721, 4791, 4788, 4788,
> 8388, 6721, 5156, *5012, 4797,
> 8388, 6707, 5161, *4963, 4795,
> 8388, 6707, *5126, 4802, 4788,
> *8048, 6700, *5021, 4802, *4687,

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-6068) [luni] Improve Integer.toString(int) performance

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

Nathan Beyer updated HARMONY-6068:
----------------------------------

    Summary: [luni] Improve Integer.toString(int) performance  (was: [java6][luni] Improve Integer.toString(int) performance)

> [luni] Improve Integer.toString(int) performance
> ------------------------------------------------
>
>                 Key: HARMONY-6068
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6068
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Jim Yu
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6068-final.diff, HARMONY-6068-merged-v1.diff, HARMONY-6068-merged-v2.diff, HARMONY-6068.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I very agree with Aleksey Shipilev' comment [1] for JIRA HARMONY-6056 as following, so I implement an optimized algorithm for  Integer.toString(int) method. Thanks to Aleksey Shipilev's benchmark,  here are the test results[2] on my windows platform.
> [1] "Ok, we can implement the in-place Integer.toString() and specialize
> the radix-10 conversion in Integer. Then Classlib performance guys
> might use the inplace conversion to optimize StringBuilder performance
> or even catch the concatenation like J9 does.
> My idea is to share whatever optimization between all VMs that use the Classlib."
> [2] 
> Result for Harmony java6 branch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 6721, 6096, *4650, *3846, *3178,
> *8080, *5833, *4447, 3731, 3048,
> *7985, *5848, 4788, 3727, *3114,
> *7891, 5592, *4389, *3560, 3048,
> 8388, 5607, *4522, 3727, 3051,
> After applied my patch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 8322, 6721, 4791, 4788, 4788,
> 8388, 6721, 5156, *5012, 4797,
> 8388, 6707, 5161, *4963, 4795,
> 8388, 6707, *5126, 4802, 4788,
> *8048, 6700, *5021, 4802, *4687,

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6068) [luni] Improve Integer.toString(int) performance

Posted by "Aleksey Shipilev (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662286#action_12662286 ] 

Aleksey Shipilev commented on HARMONY-6068:
-------------------------------------------

Right. Jim, the patch looks good, and ideally there should be no formatting changes included (there're some newlines crawled into the patch).

Of course the same block might be applied for Short and Long, but let's adopt this patch first and then generalize it for Long.toString() and Short.toString().

> [luni] Improve Integer.toString(int) performance
> ------------------------------------------------
>
>                 Key: HARMONY-6068
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6068
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Jim Yu
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6068-final.diff, HARMONY-6068-merged-v1.diff, HARMONY-6068-merged-v2.diff, HARMONY-6068.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I very agree with Aleksey Shipilev' comment [1] for JIRA HARMONY-6056 as following, so I implement an optimized algorithm for  Integer.toString(int) method. Thanks to Aleksey Shipilev's benchmark,  here are the test results[2] on my windows platform.
> [1] "Ok, we can implement the in-place Integer.toString() and specialize
> the radix-10 conversion in Integer. Then Classlib performance guys
> might use the inplace conversion to optimize StringBuilder performance
> or even catch the concatenation like J9 does.
> My idea is to share whatever optimization between all VMs that use the Classlib."
> [2] 
> Result for Harmony java6 branch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 6721, 6096, *4650, *3846, *3178,
> *8080, *5833, *4447, 3731, 3048,
> *7985, *5848, 4788, 3727, *3114,
> *7891, 5592, *4389, *3560, 3048,
> 8388, 5607, *4522, 3727, 3051,
> After applied my patch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 8322, 6721, 4791, 4788, 4788,
> 8388, 6721, 5156, *5012, 4797,
> 8388, 6707, 5161, *4963, 4795,
> 8388, 6707, *5126, 4802, 4788,
> *8048, 6700, *5021, 4802, *4687,

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (HARMONY-6068) [luni] Improve Integer.toString(int) performance

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

Tim Ellison closed HARMONY-6068.
--------------------------------


No response, assuming ok.

> [luni] Improve Integer.toString(int) performance
> ------------------------------------------------
>
>                 Key: HARMONY-6068
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6068
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Jim Yu
>            Assignee: Tim Ellison
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6068-final-V2.diff, HARMONY-6068-final.diff, HARMONY-6068-merged-v1.diff, HARMONY-6068-merged-v2.diff, HARMONY-6068-testcase.diff, HARMONY-6068.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I very agree with Aleksey Shipilev' comment [1] for JIRA HARMONY-6056 as following, so I implement an optimized algorithm for  Integer.toString(int) method. Thanks to Aleksey Shipilev's benchmark,  here are the test results[2] on my windows platform.
> [1] "Ok, we can implement the in-place Integer.toString() and specialize
> the radix-10 conversion in Integer. Then Classlib performance guys
> might use the inplace conversion to optimize StringBuilder performance
> or even catch the concatenation like J9 does.
> My idea is to share whatever optimization between all VMs that use the Classlib."
> [2] 
> Result for Harmony java6 branch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 6721, 6096, *4650, *3846, *3178,
> *8080, *5833, *4447, 3731, 3048,
> *7985, *5848, 4788, 3727, *3114,
> *7891, 5592, *4389, *3560, 3048,
> 8388, 5607, *4522, 3727, 3051,
> After applied my patch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 8322, 6721, 4791, 4788, 4788,
> 8388, 6721, 5156, *5012, 4797,
> 8388, 6707, 5161, *4963, 4795,
> 8388, 6707, *5126, 4802, 4788,
> *8048, 6700, *5021, 4802, *4687,

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6068) [luni] Improve Integer.toString(int) performance

Posted by "Regis Xu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662249#action_12662249 ] 

Regis Xu commented on HARMONY-6068:
-----------------------------------

Hi Jim,

Why does integer between -1000 and 1000 use different algorithmes? And is it ok to apply this algorithm to Short and Long?

> [luni] Improve Integer.toString(int) performance
> ------------------------------------------------
>
>                 Key: HARMONY-6068
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6068
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Jim Yu
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6068-final.diff, HARMONY-6068-merged-v1.diff, HARMONY-6068-merged-v2.diff, HARMONY-6068.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I very agree with Aleksey Shipilev' comment [1] for JIRA HARMONY-6056 as following, so I implement an optimized algorithm for  Integer.toString(int) method. Thanks to Aleksey Shipilev's benchmark,  here are the test results[2] on my windows platform.
> [1] "Ok, we can implement the in-place Integer.toString() and specialize
> the radix-10 conversion in Integer. Then Classlib performance guys
> might use the inplace conversion to optimize StringBuilder performance
> or even catch the concatenation like J9 does.
> My idea is to share whatever optimization between all VMs that use the Classlib."
> [2] 
> Result for Harmony java6 branch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 6721, 6096, *4650, *3846, *3178,
> *8080, *5833, *4447, 3731, 3048,
> *7985, *5848, 4788, 3727, *3114,
> *7891, 5592, *4389, *3560, 3048,
> 8388, 5607, *4522, 3727, 3051,
> After applied my patch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 8322, 6721, 4791, 4788, 4788,
> 8388, 6721, 5156, *5012, 4797,
> 8388, 6707, 5161, *4963, 4795,
> 8388, 6707, *5126, 4802, 4788,
> *8048, 6700, *5021, 4802, *4687,

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6068) [luni] Improve Integer.toString(int) performance

Posted by "Jim Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662256#action_12662256 ] 

Jim Yu commented on HARMONY-6068:
---------------------------------

Regis,

Because the first algorithm has better performance for small integers while the second one has better performance for big integers. We can get an overall high performance for all integers if we use different algorithm for different integers. These algorithms can definitely be applied to Short and Long just with minor change.

> [luni] Improve Integer.toString(int) performance
> ------------------------------------------------
>
>                 Key: HARMONY-6068
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6068
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Jim Yu
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6068-final.diff, HARMONY-6068-merged-v1.diff, HARMONY-6068-merged-v2.diff, HARMONY-6068.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I very agree with Aleksey Shipilev' comment [1] for JIRA HARMONY-6056 as following, so I implement an optimized algorithm for  Integer.toString(int) method. Thanks to Aleksey Shipilev's benchmark,  here are the test results[2] on my windows platform.
> [1] "Ok, we can implement the in-place Integer.toString() and specialize
> the radix-10 conversion in Integer. Then Classlib performance guys
> might use the inplace conversion to optimize StringBuilder performance
> or even catch the concatenation like J9 does.
> My idea is to share whatever optimization between all VMs that use the Classlib."
> [2] 
> Result for Harmony java6 branch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 6721, 6096, *4650, *3846, *3178,
> *8080, *5833, *4447, 3731, 3048,
> *7985, *5848, 4788, 3727, *3114,
> *7891, 5592, *4389, *3560, 3048,
> 8388, 5607, *4522, 3727, 3051,
> After applied my patch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 8322, 6721, 4791, 4788, 4788,
> 8388, 6721, 5156, *5012, 4797,
> 8388, 6707, 5161, *4963, 4795,
> 8388, 6707, *5126, 4802, 4788,
> *8048, 6700, *5021, 4802, *4687,

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-6068) [luni] Improve Integer.toString(int) performance

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

Jim Yu updated HARMONY-6068:
----------------------------

    Attachment: HARMONY-6068-final-V2.diff

> [luni] Improve Integer.toString(int) performance
> ------------------------------------------------
>
>                 Key: HARMONY-6068
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6068
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Jim Yu
>            Assignee: Tim Ellison
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6068-final-V2.diff, HARMONY-6068-final.diff, HARMONY-6068-merged-v1.diff, HARMONY-6068-merged-v2.diff, HARMONY-6068.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I very agree with Aleksey Shipilev' comment [1] for JIRA HARMONY-6056 as following, so I implement an optimized algorithm for  Integer.toString(int) method. Thanks to Aleksey Shipilev's benchmark,  here are the test results[2] on my windows platform.
> [1] "Ok, we can implement the in-place Integer.toString() and specialize
> the radix-10 conversion in Integer. Then Classlib performance guys
> might use the inplace conversion to optimize StringBuilder performance
> or even catch the concatenation like J9 does.
> My idea is to share whatever optimization between all VMs that use the Classlib."
> [2] 
> Result for Harmony java6 branch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 6721, 6096, *4650, *3846, *3178,
> *8080, *5833, *4447, 3731, 3048,
> *7985, *5848, 4788, 3727, *3114,
> *7891, 5592, *4389, *3560, 3048,
> 8388, 5607, *4522, 3727, 3051,
> After applied my patch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 8322, 6721, 4791, 4788, 4788,
> 8388, 6721, 5156, *5012, 4797,
> 8388, 6707, 5161, *4963, 4795,
> 8388, 6707, *5126, 4802, 4788,
> *8048, 6700, *5021, 4802, *4687,

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-6068) [luni] Improve Integer.toString(int) performance

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12668165#action_12668165 ] 

Tim Ellison commented on HARMONY-6068:
--------------------------------------

Tests applied at repo revision r738625.

Please check they were applied as you expected.


> [luni] Improve Integer.toString(int) performance
> ------------------------------------------------
>
>                 Key: HARMONY-6068
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6068
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Jim Yu
>            Assignee: Tim Ellison
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6068-final-V2.diff, HARMONY-6068-final.diff, HARMONY-6068-merged-v1.diff, HARMONY-6068-merged-v2.diff, HARMONY-6068-testcase.diff, HARMONY-6068.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I very agree with Aleksey Shipilev' comment [1] for JIRA HARMONY-6056 as following, so I implement an optimized algorithm for  Integer.toString(int) method. Thanks to Aleksey Shipilev's benchmark,  here are the test results[2] on my windows platform.
> [1] "Ok, we can implement the in-place Integer.toString() and specialize
> the radix-10 conversion in Integer. Then Classlib performance guys
> might use the inplace conversion to optimize StringBuilder performance
> or even catch the concatenation like J9 does.
> My idea is to share whatever optimization between all VMs that use the Classlib."
> [2] 
> Result for Harmony java6 branch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 6721, 6096, *4650, *3846, *3178,
> *8080, *5833, *4447, 3731, 3048,
> *7985, *5848, 4788, 3727, *3114,
> *7891, 5592, *4389, *3560, 3048,
> 8388, 5607, *4522, 3727, 3051,
> After applied my patch:
> (String)base + (int)add:
> -------------------------------------------
>  base length (vars with rows): 0..2..10
>   add length (vars with cols): 0..2..10
>  loop duration = 100 msecs
>  target variance = 0.05
> ops/msec, the more the better:
> 8322, 6721, 4791, 4788, 4788,
> 8388, 6721, 5156, *5012, 4797,
> 8388, 6707, 5161, *4963, 4795,
> 8388, 6707, *5126, 4802, 4788,
> *8048, 6700, *5021, 4802, *4687,

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.