From: Brian Candler Date: 2003-03-07T09:23:02+09:00 Subject: Re: XmlConfigFile usage On Sat, Mar 01, 2003 at 10:54:26AM +0900, NAKAMURA, Hiroshi wrote: > Hi, > > Here's SOAP! Is there somebody listening?! Yep, I'm listening :-) I've re-read the SOAP spec, which I actually understand a little better now after playing with YAML. I've also spent some time today getting soap4r working and have been testing with a small client-server database program. In this program, the client sends a request (a text key string), and the server reads a database row, builds a little tree of objects representing the values it contains, and returns it. Unfortunately, performance is a major problem. Using soap4r, an exchange of just 10 RPC calls takes 12.5 seconds on a Sun E250. It makes little difference whether the client and server are on different machines or not; one end is waiting for the other to marshall, and then vice versa, so CPU load is around 50% at both ends when split this way. As far as I can tell, the majority of this time is spent in marshalling and unmarshalling the objects. I did a few separate tests: - just taking the final tree and marshalling/unmarshalling it ten times takes 9.3 seconds. The XML generated is 7,137 bytes. [This is with REXML-stable; am I likely to see much improvement with a different XML parser?] - using yaml4r the same ten operations take 10.6 seconds, although the generated data is smaller at 3,396 bytes, and much easier to read - using Ruby's built-in Marshall.dump/load is staggeringly fast, taking just 0.04 seconds for the same test, and generating 1,651 bytes to represent the same object tree. In fact, using dRuby instead of SOAP, it takes only 0.3 seconds to do ten complete RPC exchanges, including the actual server work of a DBI query and building the return object tree each time! I can hardly ignore a performance factor of 250 times... unfortunately if I go with drb then I am tied to using Ruby for both front-end and back-end systems. Hence I'll lose the flexibility to get (say) a PHP programmer to write something which talks to it. Perhaps the solution is to forget SOAP, and to recode Ruby's native Marshal module for Perl, PHP, Java etc :-)) Regards, Brian.