Robert wrote:

> What exactly did CGLIB do in this case? I took a look at the web site,
> but from what I could see, CGLIB is a way to wrap classes for method
> interception ala proxy style. I'm sure I'm missing something, but I
> couldn't quite tell from the docs.

The docs need some work. The original purpose for CGLIB was as better
version of java.lang.reflect.Proxy, but it has grown into a repository for
"all things code generated". The benchmarks I generated used the BeanMap
class (net.sf.cglib.beans.BeanMap in CVS), which is a dynamic Map view of a
bean. To copy one bean to another I just did

  BeanMap.create(bean2).putAll(BeanMap.create(bean1));

I intend to eventually add a dedicated BeanCopier class which will eliminate
the remaining overhead.

Chris

> Chris Nokleberg wrote:
>> 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



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to