After using your library for quite some time without any problems we now 
encountered some performance issues.
We heavily use LocalDate's as keys in a HashMap. Therefore, the 
performance of the equals and hashCode methods
are rather important.

Would you object to providing implementations of those routines in 
LocalDate (instead of relying on the implementation
inherited from AbstractPartial that work along the following lines:

        public boolean equals(Object partial) {
                if(partial instanceof LocalDate) {
                        LocalDate other = (LocalDate)partial;
                        if(iChronology.equals(other.iChronology)) {
                                return iLocalMillis == other.iLocalMillis;
                        }
                }
                return super.equals(partial);
        }
       
        public int hashCode() {
                return (int)iLocalMillis;
        }
       
        public int compareTo(Object partial) {
                if(partial instanceof LocalDate) {
                        LocalDate other = (LocalDate)partial;
                        if(iChronology.equals(other.iChronology))  {
                                return (iLocalMillis <other.iLocalMillis 
? -1 : (iLocalMillis == other.iLocalMillis ? 0 : 1));

                        }
                }
                return super.compareTo(partial);

        }

We tried them locally and all unit tests still work OK, provided that 
one uses the latest version of LocalDate from subversion (with the 
rounding done correctly).
It also improves the performance of our application quite considerably....

Regards,

Francois.




-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Joda-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to