harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vladimir Strigun (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-4553) [drlvm][jit][perf]String.compareTo method works slowly
Date Wed, 10 Oct 2007 12:42:50 GMT

    [ 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.


Mime
View raw message