From: Jason Roelofs Date: 2007-03-20T04:22:10+09:00 Subject: Re: SOAP performance and unmarshalling/parsing speed ------=_Part_137550_22471450.1174332128953 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 3/19/07, Micah Wedemeyer wrote: > > I have been playing around with SOAP a little (as a client), and I > really like soap4r. I was able to get my SOAP client running without > too much trouble at all. > > Unfortunately, the performance is fairly slow. We have a SOAP web > service running on the localhost, but it still takes about 4-5 seconds > to get 150K of data. > > I used the wiredump to put the request/response to STDOUT, and I > realized that the actual communication is happening very fast (easily > within .5 seconds). However, it hangs for a few seconds after the > response is received, before finally returning. > > I am guessing that the unmarshalling and parsing of the returned > envelope is what is taking the most time. I have heard that Ruby is not > so great at XML parsing. > > Lucky for me, the return is one big chunk of text, and I just need to > strip off the envelope and don't need any complicated parsing of the > internals. > > So, finally, my question: What would be the quickest and easiest (in > terms of programming skill) of sending the SOAP call and getting the > resulting XML, but bypassing the parsing/unmarshalling? I think I can > handle the parsing by hand. > > Thanks, > Micah > > -- > Posted via http://www.ruby-forum.com/. > > Personally, I would highly recommend that you stay away from SOAP. It has become super bloated and just too much crap for any type of simple data transmission "protocol", and it's this bloat that is causing your slowdown. Check out using RESTful web services (ActiveResource, for one). It's still XML based communication, but it's much, much less data getting transfered. (for another plus, you can get edge ActiveSupport which add Hash#create_from_xml, doing all the parsing work for you). As for XML in Ruby, yes it's slow in pure Ruby. There are C plugin parsers around (rexml, I think), that are incredibly fast. Jason ------=_Part_137550_22471450.1174332128953--