commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <robertburrelldon...@blueyonder.co.uk>
Subject Re: [BeanUtils] Interesting Microbenchmarks
Date Mon, 25 Aug 2003 07:56:47 GMT
hi chris

i've taken a quick look and this seems interesting. i don't have time 
right now to take a good look but hopefully i will before too long.

if you are thinking about putting something together that's beanutils 
compatible then i think that it's a good idea for me to give you some idea 
where i see things going. beanutils is in the process of being beanified. 
the booch utilities are now backed by pseudo-singletons and the 
functionality implemented in concrete classes. a lot of the functionality 
will most likely be factored out so that advanced users can hook into the 
api with alternative implementation strategies.

though i think most folks are very, very keen to keep the core 
dependencies to a minimum (no more than we have now). i think that it's 
inevitable that we'll end up with an 'optional' package containing 
implementations with a wider range of dependencies. that'd allow a fast 
implementation using cglib to be added without the issue of adding cglib 
as a core dependency arising.

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).

- 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: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>


Mime
View raw message