You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Chris Nokleberg <ch...@sixlegs.com> on 2002/12/21 09:50:19 UTC

MethodClosure (BCEL Delegator implementation)

Hi!

FYI, I've checked in a MethodClosure class to the CGLIB project
(cglib.sf.net). It works almost exactly like the Delegator class in
excalibur, but is implemented using BCEL (like everything in CGLIB). The
primary benefit is performance; here are some quick numbers, all
delegating to String.indexOf(String, int):

 Time to create 100,000 delegates (ms)
    avalon:  4957
    cglib:     94

 Time to make 2,000,000 method calls (ms)
    avalon:  1366
    cglib:    136
    java:     105

It is also possible to use CGLIB as an almost drop-in replacement for
JDK 1.3 dynamic proxies, but as in this case you can often get *much*
better performance through a generated class tailored to the specific
application.

Regards,
Chris

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>