You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Vladimir Strigun (JIRA)" <ji...@apache.org> on 2007/07/26 15:00:49 UTC

[jira] Created: (HARMONY-4553) [drlvm][jit][perf]String.compareTo method works slowly

[drlvm][jit][perf]String.compareTo method works slowly
------------------------------------------------------

                 Key: HARMONY-4553
                 URL: https://issues.apache.org/jira/browse/HARMONY-4553
             Project: Harmony
          Issue Type: Bug
          Components: DRLVM
            Reporter: Vladimir Strigun


The test below shows that String.compareTo(String) method significantly slower in comparison win Sun. 

Results of test execution:
java client: 1700 msec
java server: 0 
harmony server: 3360 msec


Small test:
public class CompareToTest{
    public static void main(String[] args){
        String st1 = new String("0 1 2 3 4 5 6 7 8 9");
        String st2 = new String("0 1 2 3 4 5 6 7 8 9");
        //warmup VM
        stringCompareTo(st1, st2, 100000);
        long start = System.currentTimeMillis();
        stringCompareTo(st1, st2, 20000000);
        long end = System.currentTimeMillis() -start;
        System.out.println("String compareTo for equals strings completed in "+end +" msec");
        st1 = new String("0 1 2 3 4 5 6 7 8 9abc");
        //warmup VM
        stringCompareTo(st1, st2, 100000);
        long start1 = System.currentTimeMillis();
        stringCompareTo(st1, st2, 20000000);
        long end1 = System.currentTimeMillis() -start1;
        System.out.println("String compareTo for non equals strings completed in "+end1 +" msec");

        System.out.println("Total in "+(end1+end) +" msec");

    }

    public static void stringCompareTo(String st1, String st2, int num){
        for(int x=0; x<num; x++) {
            st1.compareTo(st2);
        }

    }
}

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


[jira] Updated: (HARMONY-4553) [drlvm][jit][perf]String.compareTo method works slowly

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

George Timoshenko updated HARMONY-4553:
---------------------------------------

    Attachment: HARMONY-4553-v2.patch

patch updated

compareTo handler fixed

> [drlvm][jit][perf]String.compareTo method works slowly
> ------------------------------------------------------
>
>                 Key: HARMONY-4553
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4553
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Strigun
>         Attachments: HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553.patch
>
>
> The test below shows that String.compareTo(String) method significantly slower in comparison win Sun. 
> Results of test execution:
> java client: 1700 msec
> java server: 0 
> harmony server: 3360 msec
> Small test:
> public class CompareToTest{
>     public static void main(String[] args){
>         String st1 = new String("0 1 2 3 4 5 6 7 8 9");
>         String st2 = new String("0 1 2 3 4 5 6 7 8 9");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end = System.currentTimeMillis() -start;
>         System.out.println("String compareTo for equals strings completed in "+end +" msec");
>         st1 = new String("0 1 2 3 4 5 6 7 8 9abc");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start1 = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end1 = System.currentTimeMillis() -start1;
>         System.out.println("String compareTo for non equals strings completed in "+end1 +" msec");
>         System.out.println("Total in "+(end1+end) +" msec");
>     }
>     public static void stringCompareTo(String st1, String st2, int num){
>         for(int x=0; x<num; x++) {
>             st1.compareTo(st2);
>         }
>     }
> }

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


[jira] Updated: (HARMONY-4553) [drlvm][jit][perf]String.compareTo method works slowly

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

George Timoshenko updated HARMONY-4553:
---------------------------------------

    Attachment: HARMONY-4553-v2-em64t.patch

forgot to tune skip tables for EM64T

> [drlvm][jit][perf]String.compareTo method works slowly
> ------------------------------------------------------
>
>                 Key: HARMONY-4553
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4553
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Strigun
>            Assignee: Mikhail Fursov
>         Attachments: HARMONY-4553-v2-em64t.patch, HARMONY-4553-v2-em64t.patch, HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553.patch
>
>
> The test below shows that String.compareTo(String) method significantly slower in comparison win Sun. 
> Results of test execution:
> java client: 1700 msec
> java server: 0 
> harmony server: 3360 msec
> Small test:
> public class CompareToTest{
>     public static void main(String[] args){
>         String st1 = new String("0 1 2 3 4 5 6 7 8 9");
>         String st2 = new String("0 1 2 3 4 5 6 7 8 9");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end = System.currentTimeMillis() -start;
>         System.out.println("String compareTo for equals strings completed in "+end +" msec");
>         st1 = new String("0 1 2 3 4 5 6 7 8 9abc");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start1 = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end1 = System.currentTimeMillis() -start1;
>         System.out.println("String compareTo for non equals strings completed in "+end1 +" msec");
>         System.out.println("Total in "+(end1+end) +" msec");
>     }
>     public static void stringCompareTo(String st1, String st2, int num){
>         for(int x=0; x<num; x++) {
>             st1.compareTo(st2);
>         }
>     }
> }

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


[jira] Assigned: (HARMONY-4553) [drlvm][jit][perf]String.compareTo method works slowly

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

Mikhail Fursov reassigned HARMONY-4553:
---------------------------------------

    Assignee: Mikhail Fursov

> [drlvm][jit][perf]String.compareTo method works slowly
> ------------------------------------------------------
>
>                 Key: HARMONY-4553
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4553
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Strigun
>            Assignee: Mikhail Fursov
>         Attachments: HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553.patch
>
>
> The test below shows that String.compareTo(String) method significantly slower in comparison win Sun. 
> Results of test execution:
> java client: 1700 msec
> java server: 0 
> harmony server: 3360 msec
> Small test:
> public class CompareToTest{
>     public static void main(String[] args){
>         String st1 = new String("0 1 2 3 4 5 6 7 8 9");
>         String st2 = new String("0 1 2 3 4 5 6 7 8 9");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end = System.currentTimeMillis() -start;
>         System.out.println("String compareTo for equals strings completed in "+end +" msec");
>         st1 = new String("0 1 2 3 4 5 6 7 8 9abc");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start1 = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end1 = System.currentTimeMillis() -start1;
>         System.out.println("String compareTo for non equals strings completed in "+end1 +" msec");
>         System.out.println("Total in "+(end1+end) +" msec");
>     }
>     public static void stringCompareTo(String st1, String st2, int num){
>         for(int x=0; x<num; x++) {
>             st1.compareTo(st2);
>         }
>     }
> }

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


[jira] Commented: (HARMONY-4553) [drlvm][jit][perf]String.compareTo method works slowly

Posted by "Vladimir Strigun (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12533726 ] 

Vladimir Strigun commented on HARMONY-4553:
-------------------------------------------

Hi George,

I've checked your patch on small testcase (haven't tested it on Dacapo yet) and have noticeable speedup for non-equals string comparison. The time of comparison in server mode reduced from 1300 to 1000 msec, however no any change for equals string comparison. Could you please explain, is it the correct behaviour?


> [drlvm][jit][perf]String.compareTo method works slowly
> ------------------------------------------------------
>
>                 Key: HARMONY-4553
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4553
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Strigun
>         Attachments: HARMONY-4553.patch
>
>
> The test below shows that String.compareTo(String) method significantly slower in comparison win Sun. 
> Results of test execution:
> java client: 1700 msec
> java server: 0 
> harmony server: 3360 msec
> Small test:
> public class CompareToTest{
>     public static void main(String[] args){
>         String st1 = new String("0 1 2 3 4 5 6 7 8 9");
>         String st2 = new String("0 1 2 3 4 5 6 7 8 9");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end = System.currentTimeMillis() -start;
>         System.out.println("String compareTo for equals strings completed in "+end +" msec");
>         st1 = new String("0 1 2 3 4 5 6 7 8 9abc");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start1 = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end1 = System.currentTimeMillis() -start1;
>         System.out.println("String compareTo for non equals strings completed in "+end1 +" msec");
>         System.out.println("Total in "+(end1+end) +" msec");
>     }
>     public static void stringCompareTo(String st1, String st2, int num){
>         for(int x=0; x<num; x++) {
>             st1.compareTo(st2);
>         }
>     }
> }

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


[jira] Updated: (HARMONY-4553) [drlvm][jit][perf]String _compareTo and _regionMatches calls replacement by REP CMPSW instructions

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

Mikhail Fursov updated HARMONY-4553:
------------------------------------

              Patch Info: [Patch Available]
    Estimated Complexity: Advanced
                 Summary: [drlvm][jit][perf]String _compareTo and _regionMatches calls replacement by REP CMPSW instructions  (was: [drlvm][jit][perf]String.compareTo method works slowly)

> [drlvm][jit][perf]String _compareTo and _regionMatches calls replacement by REP CMPSW instructions
> --------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4553
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4553
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Strigun
>            Assignee: Mikhail Fursov
>         Attachments: HARMONY-4553-v2-em64t.patch, HARMONY-4553-v2-em64t.patch, HARMONY-4553-v2-em64t.patch, HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553.patch
>
>
> The test below shows that String.compareTo(String) method significantly slower in comparison win Sun. 
> Results of test execution:
> java client: 1700 msec
> java server: 0 
> harmony server: 3360 msec
> Small test:
> public class CompareToTest{
>     public static void main(String[] args){
>         String st1 = new String("0 1 2 3 4 5 6 7 8 9");
>         String st2 = new String("0 1 2 3 4 5 6 7 8 9");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end = System.currentTimeMillis() -start;
>         System.out.println("String compareTo for equals strings completed in "+end +" msec");
>         st1 = new String("0 1 2 3 4 5 6 7 8 9abc");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start1 = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end1 = System.currentTimeMillis() -start1;
>         System.out.println("String compareTo for non equals strings completed in "+end1 +" msec");
>         System.out.println("Total in "+(end1+end) +" msec");
>     }
>     public static void stringCompareTo(String st1, String st2, int num){
>         for(int x=0; x<num; x++) {
>             st1.compareTo(st2);
>         }
>     }
> }

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


[jira] Commented: (HARMONY-4553) [drlvm][jit][perf]String.compareTo method works slowly

Posted by "Vladimir Strigun (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12536188 ] 

Vladimir Strigun commented on HARMONY-4553:
-------------------------------------------

I check the last version of patch on dacapo in server and opt mode. Unfortunately no any speedup observed as well as degradation.

> [drlvm][jit][perf]String.compareTo method works slowly
> ------------------------------------------------------
>
>                 Key: HARMONY-4553
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4553
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Strigun
>         Attachments: HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553.patch
>
>
> The test below shows that String.compareTo(String) method significantly slower in comparison win Sun. 
> Results of test execution:
> java client: 1700 msec
> java server: 0 
> harmony server: 3360 msec
> Small test:
> public class CompareToTest{
>     public static void main(String[] args){
>         String st1 = new String("0 1 2 3 4 5 6 7 8 9");
>         String st2 = new String("0 1 2 3 4 5 6 7 8 9");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end = System.currentTimeMillis() -start;
>         System.out.println("String compareTo for equals strings completed in "+end +" msec");
>         st1 = new String("0 1 2 3 4 5 6 7 8 9abc");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start1 = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end1 = System.currentTimeMillis() -start1;
>         System.out.println("String compareTo for non equals strings completed in "+end1 +" msec");
>         System.out.println("Total in "+(end1+end) +" msec");
>     }
>     public static void stringCompareTo(String st1, String st2, int num){
>         for(int x=0; x<num; x++) {
>             st1.compareTo(st2);
>         }
>     }
> }

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


[jira] Resolved: (HARMONY-4553) [drlvm][jit][perf]String _compareTo and _regionMatches calls replacement by REP CMPSW instructions

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

Mikhail Fursov resolved HARMONY-4553.
-------------------------------------

    Resolution: Fixed

the second part is committed with revision 587851.

> [drlvm][jit][perf]String _compareTo and _regionMatches calls replacement by REP CMPSW instructions
> --------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4553
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4553
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Strigun
>            Assignee: Mikhail Fursov
>         Attachments: HARMONY-4553-v2-em64t.patch, HARMONY-4553-v2-em64t.patch, HARMONY-4553-v2-em64t.patch, HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553.patch
>
>
> The test below shows that String.compareTo(String) method significantly slower in comparison win Sun. 
> Results of test execution:
> java client: 1700 msec
> java server: 0 
> harmony server: 3360 msec
> Small test:
> public class CompareToTest{
>     public static void main(String[] args){
>         String st1 = new String("0 1 2 3 4 5 6 7 8 9");
>         String st2 = new String("0 1 2 3 4 5 6 7 8 9");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end = System.currentTimeMillis() -start;
>         System.out.println("String compareTo for equals strings completed in "+end +" msec");
>         st1 = new String("0 1 2 3 4 5 6 7 8 9abc");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start1 = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end1 = System.currentTimeMillis() -start1;
>         System.out.println("String compareTo for non equals strings completed in "+end1 +" msec");
>         System.out.println("Total in "+(end1+end) +" msec");
>     }
>     public static void stringCompareTo(String st1, String st2, int num){
>         for(int x=0; x<num; x++) {
>             st1.compareTo(st2);
>         }
>     }
> }

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


[jira] Commented: (HARMONY-4553) [drlvm][jit][perf]String.compareTo method works slowly

Posted by "Mikhail Fursov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12536941 ] 

Mikhail Fursov commented on HARMONY-4553:
-----------------------------------------

HARMONY-4553-v2.patch (66 kb) was committed with revision 587413

Please check and provide em64t configuration files if need or close the JIRA.

> [drlvm][jit][perf]String.compareTo method works slowly
> ------------------------------------------------------
>
>                 Key: HARMONY-4553
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4553
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Strigun
>            Assignee: Mikhail Fursov
>         Attachments: HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553.patch
>
>
> The test below shows that String.compareTo(String) method significantly slower in comparison win Sun. 
> Results of test execution:
> java client: 1700 msec
> java server: 0 
> harmony server: 3360 msec
> Small test:
> public class CompareToTest{
>     public static void main(String[] args){
>         String st1 = new String("0 1 2 3 4 5 6 7 8 9");
>         String st2 = new String("0 1 2 3 4 5 6 7 8 9");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end = System.currentTimeMillis() -start;
>         System.out.println("String compareTo for equals strings completed in "+end +" msec");
>         st1 = new String("0 1 2 3 4 5 6 7 8 9abc");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start1 = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end1 = System.currentTimeMillis() -start1;
>         System.out.println("String compareTo for non equals strings completed in "+end1 +" msec");
>         System.out.println("Total in "+(end1+end) +" msec");
>     }
>     public static void stringCompareTo(String st1, String st2, int num){
>         for(int x=0; x<num; x++) {
>             st1.compareTo(st2);
>         }
>     }
> }

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


[jira] Updated: (HARMONY-4553) [drlvm][jit][perf]String.compareTo method works slowly

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

George Timoshenko updated HARMONY-4553:
---------------------------------------

    Attachment: HARMONY-4553-v2-em64t.patch

EM64T fixed and enabled

> [drlvm][jit][perf]String.compareTo method works slowly
> ------------------------------------------------------
>
>                 Key: HARMONY-4553
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4553
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Strigun
>            Assignee: Mikhail Fursov
>         Attachments: HARMONY-4553-v2-em64t.patch, HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553.patch
>
>
> The test below shows that String.compareTo(String) method significantly slower in comparison win Sun. 
> Results of test execution:
> java client: 1700 msec
> java server: 0 
> harmony server: 3360 msec
> Small test:
> public class CompareToTest{
>     public static void main(String[] args){
>         String st1 = new String("0 1 2 3 4 5 6 7 8 9");
>         String st2 = new String("0 1 2 3 4 5 6 7 8 9");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end = System.currentTimeMillis() -start;
>         System.out.println("String compareTo for equals strings completed in "+end +" msec");
>         st1 = new String("0 1 2 3 4 5 6 7 8 9abc");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start1 = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end1 = System.currentTimeMillis() -start1;
>         System.out.println("String compareTo for non equals strings completed in "+end1 +" msec");
>         System.out.println("Total in "+(end1+end) +" msec");
>     }
>     public static void stringCompareTo(String st1, String st2, int num){
>         for(int x=0; x<num; x++) {
>             st1.compareTo(st2);
>         }
>     }
> }

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


[jira] Updated: (HARMONY-4553) [drlvm][jit][perf]String.compareTo method works slowly

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

George Timoshenko updated HARMONY-4553:
---------------------------------------

    Attachment: HARMONY-4553-v2.patch

the -v2.patch was corrected

> [drlvm][jit][perf]String.compareTo method works slowly
> ------------------------------------------------------
>
>                 Key: HARMONY-4553
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4553
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Strigun
>         Attachments: HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553.patch
>
>
> The test below shows that String.compareTo(String) method significantly slower in comparison win Sun. 
> Results of test execution:
> java client: 1700 msec
> java server: 0 
> harmony server: 3360 msec
> Small test:
> public class CompareToTest{
>     public static void main(String[] args){
>         String st1 = new String("0 1 2 3 4 5 6 7 8 9");
>         String st2 = new String("0 1 2 3 4 5 6 7 8 9");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end = System.currentTimeMillis() -start;
>         System.out.println("String compareTo for equals strings completed in "+end +" msec");
>         st1 = new String("0 1 2 3 4 5 6 7 8 9abc");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start1 = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end1 = System.currentTimeMillis() -start1;
>         System.out.println("String compareTo for non equals strings completed in "+end1 +" msec");
>         System.out.println("Total in "+(end1+end) +" msec");
>     }
>     public static void stringCompareTo(String st1, String st2, int num){
>         for(int x=0; x<num; x++) {
>             st1.compareTo(st2);
>         }
>     }
> }

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


[jira] Updated: (HARMONY-4553) [drlvm][jit][perf]String.compareTo method works slowly

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

George Timoshenko updated HARMONY-4553:
---------------------------------------

    Attachment: HARMONY-4553.patch

The patch contains:

- API Magic HLO framework 
- String_compareTo optimization in API Magic manner.

Finally compareTo call is replaced with necessary checks and REP CMPSW instruction instead of loop for comparison.

> [drlvm][jit][perf]String.compareTo method works slowly
> ------------------------------------------------------
>
>                 Key: HARMONY-4553
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4553
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Strigun
>         Attachments: HARMONY-4553.patch
>
>
> The test below shows that String.compareTo(String) method significantly slower in comparison win Sun. 
> Results of test execution:
> java client: 1700 msec
> java server: 0 
> harmony server: 3360 msec
> Small test:
> public class CompareToTest{
>     public static void main(String[] args){
>         String st1 = new String("0 1 2 3 4 5 6 7 8 9");
>         String st2 = new String("0 1 2 3 4 5 6 7 8 9");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end = System.currentTimeMillis() -start;
>         System.out.println("String compareTo for equals strings completed in "+end +" msec");
>         st1 = new String("0 1 2 3 4 5 6 7 8 9abc");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start1 = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end1 = System.currentTimeMillis() -start1;
>         System.out.println("String compareTo for non equals strings completed in "+end1 +" msec");
>         System.out.println("Total in "+(end1+end) +" msec");
>     }
>     public static void stringCompareTo(String st1, String st2, int num){
>         for(int x=0; x<num; x++) {
>             st1.compareTo(st2);
>         }
>     }
> }

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


[jira] Updated: (HARMONY-4553) [drlvm][jit][perf]String.compareTo method works slowly

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

George Timoshenko updated HARMONY-4553:
---------------------------------------

    Attachment: HARMONY-4553-v2.patch

Vladimir,

here is new version.

- compareTo handler fixed
- regionMatches handler added

so tests with String.equals calls should also become faster

this optimizations are switchable (ON by default)

To turn them off:

-XX:jit.arg.String_compareTo_as_magic=false
-XX:jit.arg.String_regionMatches_as_magic=false

> [drlvm][jit][perf]String.compareTo method works slowly
> ------------------------------------------------------
>
>                 Key: HARMONY-4553
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4553
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Strigun
>         Attachments: HARMONY-4553-v2.patch, HARMONY-4553.patch
>
>
> The test below shows that String.compareTo(String) method significantly slower in comparison win Sun. 
> Results of test execution:
> java client: 1700 msec
> java server: 0 
> harmony server: 3360 msec
> Small test:
> public class CompareToTest{
>     public static void main(String[] args){
>         String st1 = new String("0 1 2 3 4 5 6 7 8 9");
>         String st2 = new String("0 1 2 3 4 5 6 7 8 9");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end = System.currentTimeMillis() -start;
>         System.out.println("String compareTo for equals strings completed in "+end +" msec");
>         st1 = new String("0 1 2 3 4 5 6 7 8 9abc");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start1 = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end1 = System.currentTimeMillis() -start1;
>         System.out.println("String compareTo for non equals strings completed in "+end1 +" msec");
>         System.out.println("Total in "+(end1+end) +" msec");
>     }
>     public static void stringCompareTo(String st1, String st2, int num){
>         for(int x=0; x<num; x++) {
>             st1.compareTo(st2);
>         }
>     }
> }

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


[jira] Updated: (HARMONY-4553) [drlvm][jit][perf]String.compareTo method works slowly

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

George Timoshenko updated HARMONY-4553:
---------------------------------------

    Attachment: HARMONY-4553-v2.patch

one more bug fixed

(was uncovered by gcm pass of server mode)

> [drlvm][jit][perf]String.compareTo method works slowly
> ------------------------------------------------------
>
>                 Key: HARMONY-4553
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4553
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Strigun
>         Attachments: HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553.patch
>
>
> The test below shows that String.compareTo(String) method significantly slower in comparison win Sun. 
> Results of test execution:
> java client: 1700 msec
> java server: 0 
> harmony server: 3360 msec
> Small test:
> public class CompareToTest{
>     public static void main(String[] args){
>         String st1 = new String("0 1 2 3 4 5 6 7 8 9");
>         String st2 = new String("0 1 2 3 4 5 6 7 8 9");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end = System.currentTimeMillis() -start;
>         System.out.println("String compareTo for equals strings completed in "+end +" msec");
>         st1 = new String("0 1 2 3 4 5 6 7 8 9abc");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start1 = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end1 = System.currentTimeMillis() -start1;
>         System.out.println("String compareTo for non equals strings completed in "+end1 +" msec");
>         System.out.println("Total in "+(end1+end) +" msec");
>     }
>     public static void stringCompareTo(String st1, String st2, int num){
>         for(int x=0; x<num; x++) {
>             st1.compareTo(st2);
>         }
>     }
> }

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


[jira] Commented: (HARMONY-4553) [drlvm][jit][perf]String.compareTo method works slowly

Posted by "Vladimir Strigun (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12534252 ] 

Vladimir Strigun commented on HARMONY-4553:
-------------------------------------------

Thanks, I'll check new version.

> [drlvm][jit][perf]String.compareTo method works slowly
> ------------------------------------------------------
>
>                 Key: HARMONY-4553
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4553
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Strigun
>         Attachments: HARMONY-4553-v2.patch, HARMONY-4553.patch
>
>
> The test below shows that String.compareTo(String) method significantly slower in comparison win Sun. 
> Results of test execution:
> java client: 1700 msec
> java server: 0 
> harmony server: 3360 msec
> Small test:
> public class CompareToTest{
>     public static void main(String[] args){
>         String st1 = new String("0 1 2 3 4 5 6 7 8 9");
>         String st2 = new String("0 1 2 3 4 5 6 7 8 9");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end = System.currentTimeMillis() -start;
>         System.out.println("String compareTo for equals strings completed in "+end +" msec");
>         st1 = new String("0 1 2 3 4 5 6 7 8 9abc");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start1 = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end1 = System.currentTimeMillis() -start1;
>         System.out.println("String compareTo for non equals strings completed in "+end1 +" msec");
>         System.out.println("Total in "+(end1+end) +" msec");
>     }
>     public static void stringCompareTo(String st1, String st2, int num){
>         for(int x=0; x<num; x++) {
>             st1.compareTo(st2);
>         }
>     }
> }

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


[jira] Updated: (HARMONY-4553) [drlvm][jit][perf]String.compareTo method works slowly

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

George Timoshenko updated HARMONY-4553:
---------------------------------------

    Attachment: HARMONY-4553-v2-em64t.patch

> [drlvm][jit][perf]String.compareTo method works slowly
> ------------------------------------------------------
>
>                 Key: HARMONY-4553
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4553
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Strigun
>            Assignee: Mikhail Fursov
>         Attachments: HARMONY-4553-v2-em64t.patch, HARMONY-4553-v2-em64t.patch, HARMONY-4553-v2-em64t.patch, HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553-v2.patch, HARMONY-4553.patch
>
>
> The test below shows that String.compareTo(String) method significantly slower in comparison win Sun. 
> Results of test execution:
> java client: 1700 msec
> java server: 0 
> harmony server: 3360 msec
> Small test:
> public class CompareToTest{
>     public static void main(String[] args){
>         String st1 = new String("0 1 2 3 4 5 6 7 8 9");
>         String st2 = new String("0 1 2 3 4 5 6 7 8 9");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end = System.currentTimeMillis() -start;
>         System.out.println("String compareTo for equals strings completed in "+end +" msec");
>         st1 = new String("0 1 2 3 4 5 6 7 8 9abc");
>         //warmup VM
>         stringCompareTo(st1, st2, 100000);
>         long start1 = System.currentTimeMillis();
>         stringCompareTo(st1, st2, 20000000);
>         long end1 = System.currentTimeMillis() -start1;
>         System.out.println("String compareTo for non equals strings completed in "+end1 +" msec");
>         System.out.println("Total in "+(end1+end) +" msec");
>     }
>     public static void stringCompareTo(String st1, String st2, int num){
>         for(int x=0; x<num; x++) {
>             st1.compareTo(st2);
>         }
>     }
> }

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