commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Nokleberg <ch...@sixlegs.com>
Subject Re: [BeanUtils] Interesting Microbenchmarks
Date Fri, 22 Aug 2003 00:52:09 GMT
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



Mime
View raw message