> i'm also interested to see if this technology might be useful to speed up > other components which make extensive use of reflective (such as betwixt).
Code generation is useful for server applications, but it is always good to have two implementations: 1 Reflection for testing and development (better error messages and faster startup). 2 Code generation for production (performance in long run) > > - robert > > On Friday, August 22, 2003, at 01:52 AM, Chris Nokleberg wrote: > > > Craig R. McClanahan wrote: > >> Results for PropertyUtils (no type conversions): > >> =============================================== > >> > >> Method Dest Orig Dura #1 Dura #2 > >> -------------- ---- ---- ------- ------- > >> > >> copyProperties bean bean 5,595 5,107 > >> copyProperties dyna bean 4,567 4,126 > >> copyProperties bean dyna 3,791 3,675 > >> copyProperties dyna dyna 844 681 > >> copyProperties bean map 3,938 3,755 > >> copyProperties dyna map 931 772 > > > > I modified the PropertyUtils benchmark to use CGLIB: > > > > Method Dest Orig CGLIB? Duration > > -------------- ---- ---- ------ -------- > > > > copyProperties bean bean no 4,871 > > copyProperties bean bean yes 560 > > copyProperties bean map no 2,895 > > copyProperties bean map yes 461 > > > > About a 7x speedup (JDK 1.4.1, earlier JDKs will have greater speedup). > > This is implemented in the simplest possible way using code already in > > CGLIB; greater speedups could be achieved by writing more specialized > > code, but I'd guess less than another 2x faster. > > > > BeanUtils initially wouldn't show the same improvement, since it is > > doing a bunch of other stuff too, although some of that could be > > optimized eventually--indexed/mapped properties, etc. > > > > I'll probably be putting together some sort of BeanUtils-like API in > > CGLIB. I'll make sure that it will be easy for BeanUtils to hook into if > > you decide it's something you want to do. If anyone has specific > > thoughts as to what is most needed, feel free to write me or better yet > > join the cglib-devel mailing list (http://cglib.sf.net/). > > > > Thanks, > > Chris > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]