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:
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.
2 Comments:
Great test Rong! Could you try to use XFire and add a test for SOAP/RPC?
Unfortunately I don't have the environement set up to repeat the experiment now. Maybe you could do it. :)
Post a Comment
<< Home