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 14:58:40 UTC

[jira] Created: (HARMONY-4552) [drlvm][jit][perf]instanceof operation works slowly in server mode

[drlvm][jit][perf]instanceof operation works slowly in server mode
------------------------------------------------------------------

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


The test below shows that instanceof significantly slower in comparison win Sun. 

Results of test execution:
java client: 2500 msec
java server: 31 msec 
harmony server: 4000 msec


Small test:
public class Test {
    public static void main(String[] args) {
        runTest(1000, new String());
        long start = System.currentTimeMillis();
        runTest(1000000000, new String());
        long end = System.currentTimeMillis() - start;
        System.out.println("completed in "+end);
    }

    public static void runTest(int num, Object obj) {
        for(int i=0; i<num; i++) {
            if(obj instanceof String){} 
        }
    }
}


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


[jira] Commented: (HARMONY-4552) [drlvm][jit][perf]instanceof operation works slowly in server mode

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

Mikhail Fursov commented on HARMONY-4552:
-----------------------------------------

Vladimir, 
1) 
What will be performance on your PC if you remove this line '
//if(obj instanceof String){} '
from the test?

Actually instanceof helper is not used in this test at all because String class is final, so instanceof is replaced by direct Vtable comparison in translator.


2)
I checked -Xem opt log for this method and see that this check is eliminated and we measure empty loop performance here.
With loop unrolling turned off I've got the same code for -Xem:server and -Xem:opt for this method with the only difference in registers names used.
But -Xem:opt mode was executed 4 times faster.... Looks like code placing issue to me. Can you recheck it please?
(JIT=-Xem:server/opt  -XX:jit.arg.optimizer.unroll=off)

> [drlvm][jit][perf]instanceof operation works slowly in server mode
> ------------------------------------------------------------------
>
>                 Key: HARMONY-4552
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4552
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Strigun
>            Assignee: Mikhail Fursov
>
> The test below shows that instanceof significantly slower in comparison win Sun. 
> Results of test execution:
> java client: 2500 msec
> java server: 31 msec 
> harmony server: 4000 msec
> Small test:
> public class Test {
>     public static void main(String[] args) {
>         runTest(1000, new String());
>         long start = System.currentTimeMillis();
>         runTest(1000000000, new String());
>         long end = System.currentTimeMillis() - start;
>         System.out.println("completed in "+end);
>     }
>     public static void runTest(int num, Object obj) {
>         for(int i=0; i<num; i++) {
>             if(obj instanceof String){} 
>         }
>     }
> }

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


[jira] Commented: (HARMONY-4552) [drlvm][jit][perf]instanceof operation works slowly in server mode

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

Mikhail Fursov commented on HARMONY-4552:
-----------------------------------------

Here is my numbers for this test 

SUN 1.5_06
java Test: 2200
java -server Test: 0  (method is inlined and loop is eliminated??)

Harmony:
-Xem:jet:  9000
-Xem:opt  9000
-Xem:server: 3400
-Xem:server -XX:jit.arg.optimizer=off: 1600

These are very interesting results. We need to carefully analyze affects of
1) loop peeling
2) loop unrolling
3) copy propagation
4) instanceof helper inlining
5) CG optimization for instanceof check
may be some other optimization I missed here.

I can provide help here from JIT side, but afraid I will not have a time in the nearest 2 weeks to work on this issue by myself.






> [drlvm][jit][perf]instanceof operation works slowly in server mode
> ------------------------------------------------------------------
>
>                 Key: HARMONY-4552
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4552
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Strigun
>            Assignee: Mikhail Fursov
>
> The test below shows that instanceof significantly slower in comparison win Sun. 
> Results of test execution:
> java client: 2500 msec
> java server: 31 msec 
> harmony server: 4000 msec
> Small test:
> public class Test {
>     public static void main(String[] args) {
>         runTest(1000, new String());
>         long start = System.currentTimeMillis();
>         runTest(1000000000, new String());
>         long end = System.currentTimeMillis() - start;
>         System.out.println("completed in "+end);
>     }
>     public static void runTest(int num, Object obj) {
>         for(int i=0; i<num; i++) {
>             if(obj instanceof String){} 
>         }
>     }
> }

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


[jira] Assigned: (HARMONY-4552) [drlvm][jit][perf]instanceof operation works slowly in server mode

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

Mikhail Fursov reassigned HARMONY-4552:
---------------------------------------

    Assignee: Mikhail Fursov

> [drlvm][jit][perf]instanceof operation works slowly in server mode
> ------------------------------------------------------------------
>
>                 Key: HARMONY-4552
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4552
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Strigun
>            Assignee: Mikhail Fursov
>
> The test below shows that instanceof significantly slower in comparison win Sun. 
> Results of test execution:
> java client: 2500 msec
> java server: 31 msec 
> harmony server: 4000 msec
> Small test:
> public class Test {
>     public static void main(String[] args) {
>         runTest(1000, new String());
>         long start = System.currentTimeMillis();
>         runTest(1000000000, new String());
>         long end = System.currentTimeMillis() - start;
>         System.out.println("completed in "+end);
>     }
>     public static void runTest(int num, Object obj) {
>         for(int i=0; i<num; i++) {
>             if(obj instanceof String){} 
>         }
>     }
> }

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