Native RMI optimization
Bryce McKinlay
mckinlay@redhat.com
Tue Mar 21 17:38:00 GMT 2006
Rui Wang wrote:
> My understanding of GCJ-compiled native RMI is that it should run faster
> than Java RMI. Having said that, I did a test to see the speed of pure
> RMI calls. By pure, I mean client calls a empty remote method. If I
> measure the time in between, this should give me the RMI call time,
> right? Here is a set of results I got (I have also attached my source
> code and shell script with this email):
>> Oddly enough, when the number of calls are small, the native rmi is
> faster than java rmi, but when the number grows bigger, it actually
> becomes slower. Any ideas why? I know GCJ version of RMI has not been a
> focus of the development, would this be the reason? Or is it something
> to do with my code?
>
These numbers are pretty much with what I'd expect. On one hand, Sun's
Hotspot is a good compiler/runtime, and will sometimes outperform
GCJ-compiled code on benchmarks like this. In addition, the libgcj/GNU
Classpath implementation of Object serialization may not be as
well-optimized as it could be.
The reason why GCJ wins the benchmark with a small number of iterations
is that it has much lower startup overhead than Hotspot. That is, during
the first iterations the GCJ code is already running at full speed while
Hotspot is still busy compiling and optimizing the code.
Bryce
More information about the Java
mailing list