Performance analysis between WebService and Socket

K

kruiz

Hi,

I'm seeking for the wisdom of gods, he he.
I made a smart client application (Windows CE emulator) to test how
fast is to call a XML Web service or to use a plain socket and my own
messaging protocol.

Both XML Web Service and Console Socket Server App (TCP, Stream, on
port 8000), call the same method that brings the first 100 records from
the orders table in the Northwind Database (SQL 2000). A dataset is
returned by it.

My analysis is very plain.
With a traffic applciation, I can monitor how much bytes are
transmitted back and forth the MS TCP Loopback interface(network card
for W.CE Emulator). So what the data tells me is that the WebService is
quite slower than the Sockets, but they transmit less bytes. How can
this be?. The theory tells us that SOAP is a lot heavier than a custom
format, right?, then why is this happening?. Sure the sockets are twice
as quick than SOAP, but are still heavier.

My guess is in packets. The XML Web Service transmits only (for
example) 100 packets vs the Sockets that transmit 1905 packets. Is this
the real reason?. Then what should I use: the WS or Sockets? The bytes
sent by the sockets protocol can be up twice of the SOAP.

I'm very puzzled by this.
Any ideas?
 
K

kruiz

I came up with this last night, could it be because of the encoding
used? I use Encoding.Default.GetBytes to transform from string to byte
array. Would it be possible that the bytes are being generated with
unicode encoding, doubling up the message?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top