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] Created: (HARMONY-4551) [drlvm][gc_gen][perf]improvement for System.identityHashCode method
Date Thu, 26 Jul 2007 12:55:40 GMT
[drlvm][gc_gen][perf]improvement for System.identityHashCode method
-------------------------------------------------------------------

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


System.identityHashCode could be faster if implemented via vmmagic code. 
The next implementation shows significant speedup on small testcase (from 1609 msec for un-patched
version to 409 msec on patched one):
return ObjectReference.fromObject(object).toAddress().toInt()

Small test:
public class Test {

    public static void main(String[] args) {
        runTest(1000, new Object());
        long start = System.currentTimeMillis();
        runTest(10000000, new Object());
        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++) {
            System.identityHashCode(new Object());
        }
    }
}


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