>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, Frankie ----- Original Message ----- From: "Aaron Mulder" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> 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 more > > apparant when the methods are called frequently. JBoss CMP implementation > > is, AFAIK, reflection-based and its performance is really disappointing. I'd > > prefer some sort of on-the-fly compilation mechanisms that need to be done > > 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 > >
