JAU (Java Annotation Based Utilities) 1.0
JAU 1.0 is ready for download from the project site: http://code.google.com/p/jau/.
The library will help you to implement common methods like .equals() or .hashCode() using annotations.
As promised in my last post, I did some performance analysis and here are results for toString() on this "real life" class (lower bar is better). The full performance report is here.

As expected, manually implemented methods are faster than JAU (which uses reflection).
- for "small" field types (byte, int, float) performance of equals()/hashCode() implemented with JAU depends heavily on the number of fields and is much worse than in manually implemented methods
- for an object with one String field the value of the field must be of length 500 or higher for JAU overhead to become neglectable
- toString() performance of JAU is really good even for classes with many small fields
Tags:
- Login or register to post comments
- 2042 reads
- Printer-friendly version
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)



