geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leo Simons <>
Subject Re: Reflection Bad, OO and direct Method invocation Good...
Date Sat, 09 Aug 2003 13:50:52 GMT
John C. Dale wrote:

> I'm concerned about your mention of reflection.  I really like 
> reflection, and think it has many useful applications in the 
> application development space, but should be kept out of any runtime 
> application that has stringent scalability and performance requirements.

it should be kept out of *any* code that has stringent performance 
Indeed! One should know when to use the right tool.

But in all applications I have ever developed using containers that use 
operations, (usually to do instantiation and facilitate late binding), 
those operations
have never turned out to be the bottleneck.

99% of time is spent doing I/O, waiting for locks, or doing actual 
If the development time gained by using some ingenious proxying or 
code you write once and use in the right place, is spent optimizing the 
code, your app becomes lighting fast.

The trick is to write most of your application so that it does not care 
it is subject to reflection of any kind at any point. If it turns out 
that's your
bottleneck, you can always take it out and replace it with something 

> Here are some dramatic results:

ehm. Why are they dramatic? Reflection is known to be slow, yes, but 
I've yet
to see hard figures showing it being the bottleneck in any realistic system.


- Leo

View raw message