From: Brian Candler Date: 2003-03-07T22:58:47+09:00 Subject: Re: SOAP, DRb and direct method call (was Re: XmlConfigFile usage) --RASg3xLB4tUQ4RcS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Mar 07, 2003 at 10:05:22PM +0900, NAKAMURA, Hiroshi wrote: > > 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... > > 250 times! Definitely rpc via soap is slower than drb, > but 250 times is too much. I think there should be another > bottleneck, TCP socket creation, loading WSDL everytime for example. I've done some more tests too, and SOAP still seems to be the major bottleneck. Maybe it's to do with the way I'm using it? What I've done is taken my app and cut it down to the bare minimum. It's attached to this mail as a tgz because I've used a long constant string to import the result object (lazy!). The server returns this object in response to an RPC request, and the client makes 100 such requests. Running both server and client on the same FreeBSD / PIII-400 laptop I get: DRb: 0.31 seconds soap4r: 48.6 seconds => 160 times slower Modifying the client to point to a remote server, which is a Sun (E250? It's in a different building and I don't have the spec to hand, but it's not in use by anyone else), and the client on the same FreeBSD box, I get: DRb: 0.85 - 0.92 seconds soap4r: 54.8 - 56.3 seconds => 60 times slower So introducing a TCP socket dilutes the SOAP overhead somewhat, but it is still pretty huge. Half a second to marshal and unmarshal a relatively small cluster of objects is something I'm not going to be able to live with. I've included a separate program which compares just the marshal+unmarshal times: $ ruby justmarshal.rb Ruby: 0.130195 SOAP: 28.341594 Ruby is 217.6857329 times faster $ ruby justmarshal.rb Ruby: 0.129693 SOAP: 28.590072 Ruby is 220.4442183 times faster $ ruby justmarshal.rb Ruby: 0.129829 SOAP: 28.891096 Ruby is 222.5319151 times faster So I stand by my original "250 times faster", allowing for some experimental error :-) Which XML parser are you using? I have only REXML installed. Regards, Brian. --RASg3xLB4tUQ4RcS Content-Type: application/x-tar-gz Content-Disposition: attachment; filename="soapperf.tgz" Content-Transfer-Encoding: base64 H4sIABalaD4AA+1Ye2/iRhDP3/4UI04V0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