geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frankie Lam" <>
Subject Re: Reflection Bad, OO and direct Method invocation Good...
Date Sat, 09 Aug 2003 14:32:57 GMT
>From what I saw from JBoss implementation (in debugger only, I have never
digged into the source code), it uses a proxy to construct a value object
dynamically using reflection. 100 reflections aren't that much when you have
* a single row *, but when you encounter a table with, say, 40 fields and
you want to load 1000 records, then it takes 40000 reflection operations. In
addition, persistence is essential to any J2EE applications. So if there are
10 users requesting data per second, then it's 400000 operations. Of course
it isn't that much when you count CPU cycles.

But the point is: Why do we want to stress the CPU on the operations that we
can save?

Best regards,

----- Original Message -----
From: "Aaron Mulder" <>
To: <>
Sent: Saturday, August 09, 2003 11:05 PM
Subject: Re: Reflection Bad, OO and direct Method invocation Good...

> On Sat, 9 Aug 2003, Frankie Lam wrote:
> > I fully agree with you and the benchmark you made is really persuasive
> > I would like to raise a point that the disadvantages of reflection are
> > apparant when the methods are called frequently. JBoss CMP
> > is, AFAIK, reflection-based and its performance is really disappointing.
> > prefer some sort of on-the-fly compilation mechanisms that need to be
> > once only instead.
> Wait, I'm confused.  Let's say a CMP operation uses 100 reflection
> operations (which is outrageous).  According the the benchmark that you
> fully agree with, you have now officially wasted 0.0000223 seconds.  Did
> you catch that on your stopwatch?
> Aaron

View raw message