Wednesday, February 23, 2005

Spring remoting compared

Spring framework supports several remoting mechanisms. I've always wondered how they perform comparing to each other. So today I did a quick a comparison. In the application we are developing, the Swing GUI client retrieves several thousand objects from the server at startup. With straight RMI, the retrieval typically takes 1-2 seconds.

To test the other methods (Spring's HTTP invoker, Hessian, Burlap), I need a web container. It took a while to set up jetty since I haven't used it before, but once I got that going it was trivial to switch the remoting methods.

Here are the numbers:

RMI: ~2 seconds
Spring's HTTP invoker: ~2 seconds
Hessian: 16-17 seconds
Burlap: 16-17 seconds

A few points of note:
  • It makes sense that Spring's HTTP invoker performs similarly to RMI since both rely on java serialization under the cover. It's good to know that the HTTP protocol doesn't add much overhead.
  • I was a little surprised that Hessian/Burlap performed so badly. The objects we retrieve are detached Hibernate objects. I wonder if that has anything to do with this.
  • It's also surprising Burlap and Hessian performed similarly since Burlap uses XML while Hessian is a binary protocol.
This is just a simple test using our codebase in our environment. But still. I wonder if Hessian/Burlap are really that slow or I am missing on something obvious.

2 Comments:

Anonymous Anonymous said...

Great test Rong! Could you try to use XFire and add a test for SOAP/RPC?

5:28 PM  
Blogger Rong said...

Unfortunately I don't have the environement set up to repeat the experiment now. Maybe you could do it. :)

12:11 PM  

Post a Comment

<< Home