avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Nokleberg <ch...@sixlegs.com>
Subject MethodClosure (BCEL Delegator implementation)
Date Sat, 21 Dec 2002 08:50:19 GMT

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


To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>

View raw message