harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jimmy,Jing Lv" <firep...@gmail.com>
Subject [classlib][util]java6 TreeMap improvement
Date Tue, 26 Aug 2008 10:31:12 GMT
Hi All,

    As we discussed before, I plan to merge TreeMap performance
improvement into Harmony java6 level, which have many API enhancement,
and the structure of code refactors a lot due to the API changes.
Currently I am close to finish.
    Mainly Java6 TreeMap has a new interface "NavigableMap"  which
requires a lot more operations on TreeMap as ascending/descending the
map, define submaps and entries more precisely. That's the reason we
have many different inner classes for TreeMap. And in Harmony5 TreeMap
performance improvement,  the basic Node/Entry of the TreeMap is
changed so it requires a big change in the whole TreeMap class and its
variety of child classes.
    I've tried best to avoid performance downgrading with API changes
in java6. The main solution is that I try to keep simple operations as
it is in java5,  that is, if some methods are changed due to Java6
inner classes changes at the begining, I may try to keep a java5 inner
class and operate it. That's why the size of java6 TreeMap has
increased a bit.   However with some benchmark it shows the
performance was at least no worse than harmony java5 TreeMap. And I've
add a few more test cases to ensure the correctiveness of the
refactor, and also fix some bugs that remains in the original java6

    I'll soon commit the fix.  I believe there's still a lot to be
improved here, e.g, reduce the class size, refactor/merge some inner
classes, and improve some methods that are not optimized yet.

Best Regards!

Jimmy, Jing Lv
China Software Development Lab, IBM

View raw message