geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Blewitt <>
Subject Re: Performance: Reflection/proxies/JMX
Date Thu, 07 Aug 2003 12:04:34 GMT
> AFAIK currently there are three approaches to the EJB problem domain
> 	1. Managing the EJB's using reflection
> 	2. Managing the EJB's through dynamic proxies
> 	3. Managing the EJB's using JMX
> Of these, the last one is newest and thus has the least references.  
> There is a good
> academic study on the first two approaches  
> (> perf_scalability_ejb.pdf)
> which states that there is no major performance  differences between  
> the two.

I'm not sure that JMX will necessarily give any better performance than  
other approaches; the main purpose of JMX (IMHO) is to provide a  
configuration mechanism to allow external agents to  
monitor/change/invoke methods.

That said, I don't believe building on top of JMX and having the whole  
architecture dependent on JMX messages makes sense particularly, though  
it would of course be beneficial to have a JMX interface on top (rather  
than underneath).

My money would be on reflection rather than dynamic proxies; a lot of  
the more recent JVMs have spent time specifically optimising  
Method.invoke for just these sort of applications. And since we're  
going to have to go from some kind of String method name (from a  
network request) -> lookup Method -> invoke, we might as well use  
reflection for the direct process, rather than storing a dynamic proxy  
and then indirecting through that.

I've had a quick perusal of the document above, but I'm not convinced  
of the results being indicative of one being faster than the other. The  
document talks a lot about 'JBoss using dynamic proxies rather than  
JoNaS using pre-compiled classes', which just dictates when the RMI  
layer gets generated/compiled -- not how fast it is when executed.  
Plus, the measurements are based on results testing the whole system,  
and thus it's not necessarily the case that just because Operation A on  
Server A takes longer than Operation B on Server B that one low-level  
choice that Server A has made is the right one. It could be that a  
bunch of the other code is more optimised, for example.

Perhaps tests (on multiple architectures) would be desirable to find  
out how fast one approach is over another. For my money, dynamic  
proxies are a bit of a kludge that are useful to developers who wish to  
write minimal code than necessarily generating the fastest code.

But then, which is more desirable -- maintenance or speed? :-)


View raw message