harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gregory Shimansky (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-4555) [drlvm][thread][perf]Thread.currentThread() works slowly
Date Tue, 05 Feb 2008 17:00:30 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-4555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12565811#action_12565811
] 

Gregory Shimansky commented on HARMONY-4555:
--------------------------------------------

This patch fails to compile on Linux x86_64 and the reason is simple. Trying to return an
address as jint doesn't seem like a good idea on 64-bit platform in this function

VMEXPORT jint JNICALL
Java_org_apache_harmony_drlvm_thread_ThreadHelper_getThreadJavaObjectOffset(JNIEnv *env, jclass
klass)
{
    vm_thread_t vm_thread = NULL;
    return (jint)&vm_thread->java_thread;
}

Probably it should return jlong?

> [drlvm][thread][perf]Thread.currentThread() works slowly
> --------------------------------------------------------
>
>                 Key: HARMONY-4555
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4555
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Vladimir Strigun
>            Assignee: Gregory Shimansky
>         Attachments: Thread.currentThread-VMMagic-workaround-2.patch, Thread.currentThread-VMMagic-workaround.patch,
Thread.currentThread-VMMagic.patch, Thread.currentThread-VMMagic.patch
>
>
> The test below shows that Thread.currentThread() method significantly slower in comparison
win Sun. 
> I believe implementation of method through vmmagic could singnificanlty improve the situation.
> Results of test execution:
> java client: 200 msec
> java server: 20 
> harmony server: 5800 msec
> Small test:
> public class CurrentThreadTest {
>     public static void main(String[] args) {
>         long st = System.currentTimeMillis();
>         for(int i=0; i< 100000000; i++) {
>             Thread.currentThread();
>         }
>         long res = System.currentTimeMillis()-st;
>         System.out.println("res="+res);
>     }
> }

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