Colin Fleming wrote: > Wow, interesting! That would provide a huge speedup for most apps, I > would think. Interesting that for the server VM in 1.5 there's really > no difference. > > BTW I found this following Crazy Bob's blog: > > http://crazybob.org/2007/01/fast-reflection.html > > He seemed to get a 40% speedup on Java 5, but doesn't give details > about the operation's he's using. There's a comment there also saying > that if you turn off the security checks you can get close to direct > speed (although Bob says he was doing that - maybe that's why he sees > more difference than you). That's interesting! With setAccesible(true) java.lang.reflect is comparable to CGLIB on Java6:
java -client: Reflection: 260 ms (2.61) CGLIB FastMethod: 249 ms (2.46) CGLIB InvokeByIndex: 247 ms (2.43) Direct: 72 ms java -server: Reflection: 197 ms (8.38) CGLIB FastMethod: 186 ms (7.86) CGLIB InvokeByIndex: 198 ms (8.43) Direct: 21 ms > > BTW mina-sm looks excellent, very interesting design. I haven't tried > it but I'll play around with it if I get a chance. Let me know if you get the chance. I'd love to get some feedback on it. -- Niklas Therning www.spamdrain.net