commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert <rob...@bull-enterprises.com>
Subject Re: [BeanUtils] Interesting Microbenchmarks
Date Mon, 06 Oct 2003 03:32:02 GMT
By 'generated', do you mean a runtime class generated (something like 
BCEL for example), not source generation which is then compiled?

The numbers are impressive regardless.

Robert

Chris Nokleberg wrote:

> I finally got around to adding a dedicated BeanCopier class to CGLIB.
> The API looks something like:
> 
>   BeanCopier copier = BeanCopier.create(bean1.getClass(), bean2.getClass());
>   copier.copy(bean1, bean2);
> 
> The copiers are cached, but if you can reuse the very same instance you get
> much faster times, so I've benchmarked both ways. This is for 100000
> iterations on JDK 1.4.2_01 (Linux).
> 
>   CGLIB? Reuse copier? Duration
>   ------ ------------- --------
>   No     N/A           4,110 ms    <-- PU.copyProperties(bean,bean)
>   Yes    No               87 ms
>   Yes    Yes               5 ms
> 
> The results were better than I expected :-) The generated code is very
> simple which I think lets HotSpot really go to town.
> 
> Chris
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 



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