From: "NAKAMURA, Hiroshi" Date: 2003-03-08T00:20:13+09:00 Subject: Re: SOAP, DRb and direct method call (was Re: XmlConfigFile usage) Hi, > From: "Brian Candler" > Sent: Friday, March 07, 2003 10:58 PM > 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? I misunderstood you. You said ruby's marshal : soap marshal = 1 : 250 I thought druby's call : soap's call = 1 : 250 The last testsuite of mine is for the latter. Ruby's marshal is 300 times faster than soap? Should be. The larger object, soap's marshal may get more slowner. > So I stand by my original "250 times faster", allowing for some experimental > error :-) You are correct. And more: Marshal: binary string/stream <-> Ruby's object SOAP4R: XML string/stream <-> SOAP Data Model <-> Ruby's object So SOAP4R will never be as fast as Marshal, even if I'll rewrite it in C. > 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. Thanks. I wrote a server with webrick, which supports HTTP/1.1 persistent connection to reduce TCP sockets. $ ruby18 drbclient.rb 0.110000 0.140000 0.250000 ( 0.752000) $ ruby18 soapclient-xmlscan.rb 14.130000 0.822000 14.952000 ( 25.227000) $ ruby18 soapclient-rexml.rb (with soapserver-rexml.rb) 12.018000 0.821000 12.839000 ( 23.880000) 30 times slower. Hmm. I should get profile. Regards, // NaHi