performance difference in Webservice -'Normal' way

D

DraguVaso

Hi,

I'm new to WebServices, and I'm doing some tests (with a small
VB.NET-application) to know the performance-difference between a WebService
and the 'normal'-way of getting data (just connecting directly with a
SqlDataAdapter to the SQL Server). The WebMethod simply gives a DataSet
back, and does exactly the same actions as the normal-Method does.

The difference are enormous in my opinion:
1 record:
WebService: 0,03125 seconds
Normal: 0,0156 seconds ->only 50% of WebService

10 records:
WebService: 0,0468 seconds
Normal: 0,016 seconds -> only 33,33% of WebService

100 records:
WebService: 0,125 seconds
Normal: 0,0156 seconds -> only 12,5% of WebService

1000 records:
WebService: 1,14 seconds
Normal: 0,93 seconds -> only 8,22% of WebService

How does this come? The webservice is even local! So I guess it will take
much more time when it wil be on another Server...
Is there a way to have a better performance? and why using WebServices if
they score so bad in performance?

Thanks a lot in advance for any hints etc

Pieter
 
M

Marina

1. Do your tests in a loop 100 times. Or 1000 times. That will be more
accurate.
2. Web services take time because the request has to be packaged and sent.
Data has to be serialized and deserialized. Requests have to be processed
and responses sent. Even if it all on the same machine.

But yes, calling a web service will always be slower then executing code
directly. That is why you don't want to do it unless your application
requires it.
 
D

DraguVaso

Thanks!
And isn't there any way to to speed things up a little bit? The fact is: in
my case it could be helpfull, because it should be used by our own people
(Windows Forms application), and give a consultancy-option to our Clients
(Web interface).

But why are people giving such an importance to XML Webservices? I know some
big software-companies that pass everything by a WebServices, even local
Windows forms applications. I was alreaddy sceptic about the technique, but
now I am even more sceptic to use it... :-/
 
P

Patrice

Do you remember when everybody was talking about IA engines ;-) I meant that
"hot stuff" is discussed likely more without necessarily reflecting real
use.


You could try a monitoring tool to make sure it goes into serializing/http
transmission/deserializing. By constrast ADO.NET uses the native SQL Server
protocol.

For now it doesn't look that bad to me. IMO the real question is how much
often do you need to call this ?

It greatly depends on the kind of application you are writing (for some
applications you could even use a "checkout", "checkin" model that would
allow to work locally a while before making new data available).

In any case you are not forced to use web services if this is not needed...
--

Patrice

Andrew Morton said:
DraguVaso wrote:
[snip]
But why are people giving such an importance to XML Webservices? I

Because it has an X in its name :-(

Andrew
 
G

Guest

hi
My opinin is different time is not at all issue for today's high speed
processor.
you can compromise time by compatible hardware.but in future if you need to
built onother application for your company then you can use existing web
services and devlopment will be faster
 
D

DraguVaso

What do you mean with "compatbile hardware"? :)
Will my Webservice have much better performance when turning on a real
server (better processor, more ram) than my local pc? Or will the
network-than consume more?
 
G

Guest

hi,

Try to understand my point ,if you run the same code on 64 bit machin
performance will always be greater that 32 bit machin isn.t it?
My point is this doesn't affects applications that much than what web
service gives us i.e. ability to built destributed application with fare ease
and less complexity.
there is another way also . net remoting which gives better performance but
it is platform specific.if you are building distributed applications
ondifferent platform then there is no choice for you. you can not use
'normal'-way of getting data.
Thats benifeet of webmethods\
 
C

Cor Ligthert

Mahesh,
Try to understand my point ,if you run the same code on 64 bit machin
performance will always be greater that 32 bit machin isn.t it?

No in my opinion is an application always as fast as the smallest part of
the pipe.

With a webservice that is to day the transport of the data.

Because the fact that the format using it direct is not the same as using a
webservice, will there always be a difference. For that are no absolute
figurs to give, because with one active user on a 1Gb Ethernet Lan, that
will be much quicker than with 100 users on a 2Mb Ethernet Lan.

In my opinion has the speed always to be in a way that it is for the user
comfortable. To get it in one milliseconds or 500 millisecond is mostly not
important because the user will normally not see that (mostly is with a sent
or get of data a natural restpoint of the usere involved, so it can be even
take some more time until maximum 3 seconds before there is a wait text
needed).

I hope that this gives an idea.

Cor
 

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