Webservice -'Normal'方式的性能差异 [英] performance difference in Webservice -'Normal' way

查看:42
本文介绍了Webservice -'Normal'方式的性能差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我是WebServices的新手,我正在做一些测试(用一个小的
VB.NET应用程序)了解WebService

和''normal''之间的性能差异 - 获取数据的方式(只需直接与

SqlDataAdapter连接到SQL Server) 。 WebMethod简单地给了一个DataSet

,并且做了与普通方法完全相同的操作。


我认为差别很大:

1条记录:

WebService:0,03125秒

正常:0,0156秒 - >只有50%的WebService


10条记录:

网络服务:0,0468秒

正常:0,016秒 - >只有33.33%的WebService


100条记录:

WebService:0,125秒

正常:0,0156秒 - > ;只有12.5%的WebService


1000条记录:

WebService:1,14秒

正常:0,93秒 - >只有8,22%的WebService


这是怎么来的?网络服务甚至是本地的!所以我想它会花费更多时间在另一台服务器上...

有没有办法获得更好的性能?为什么使用Web服务如果他们在性能上得分如此糟糕?


提前感谢任何提示等等


Pieter

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

推荐答案

1。在循环中进行100次测试。或者1000次。这将更准确。

2.网络服务需要时间,因为请求必须打包并发送。

数据必须是序列化和反序列化。必须处理请求

并发送回复。即使它都在同一台机器上。


但是,调用Web服务总是比直接执行代码

慢。这就是为什么你不想这样做,除非你的申请需要它来支付。


" DraguVaso" < PI ********** @ hotmail.com>在消息中写道

新闻:Od ************** @ TK2MSFTNGP10.phx.gbl ...
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.

"DraguVaso" <pi**********@hotmail.com> wrote in message
news:Od**************@TK2MSFTNGP10.phx.gbl...

我是WebServices的新手,我正在做一些测试(用一个小的VB.NET应用程序)来了解一个
WebService之间的性能差异。 />和''normal'' - 获取数据的方式(只是直接连接到SqlDataAdapter到SQL Server)。 WebMethod简单地返回一个DataSet,并且执行与Normal-Method完全相同的操作。

我认为差异很大:
1记录:
WebService:0,03125秒
正常:0,0156秒 - >只有50%的WebService

10条记录:
WebService:0,0468秒正常:0,016秒 - >只有33.33%的WebService

100条记录:
WebService:0,125秒
正常:0,0156秒 - >只有12.5%的WebService

1000条记录:
WebService:1,14秒
正常:0,93秒 - >只有8,22%的WebService

这是怎么来的?网络服务甚至是本地的!所以我想它会花费更多的时间在另一台服务器上......
有没有办法获得更好的性能?为什么使用WebServices如果他们的性能得分如此糟糕?

提前感谢任何提示等

Pieter
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



1。在循环中进行100次测试。或者1000次。这将更准确。

2.网络服务需要时间,因为请求必须打包并发送。

数据必须是序列化和反序列化。必须处理请求

并发送回复。即使它都在同一台机器上。


但是,调用Web服务总是比直接执行代码

慢。这就是为什么你不想这样做,除非你的申请需要它来支付。


" DraguVaso" < PI ********** @ hotmail.com>在消息中写道

新闻:Od ************** @ TK2MSFTNGP10.phx.gbl ...
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.

"DraguVaso" <pi**********@hotmail.com> wrote in message
news:Od**************@TK2MSFTNGP10.phx.gbl...

我是WebServices的新手,我正在做一些测试(用一个小的VB.NET应用程序)来了解一个
WebService之间的性能差异。 />和''normal'' - 获取数据的方式(只是直接连接到SqlDataAdapter到SQL Server)。 WebMethod简单地返回一个DataSet,并且执行与Normal-Method完全相同的操作。

我认为差异很大:
1记录:
WebService:0,03125秒
正常:0,0156秒 - >只有50%的WebService

10条记录:
WebService:0,0468秒正常:0,016秒 - >只有33.33%的WebService

100条记录:
WebService:0,125秒
正常:0,0156秒 - >只有12.5%的WebService

1000条记录:
WebService:1,14秒
正常:0,93秒 - >只有8,22%的WebService

这是怎么来的?网络服务甚至是本地的!所以我想它会花费更多的时间在另一台服务器上......
有没有办法获得更好的性能?为什么使用WebServices如果他们的性能得分如此糟糕?

提前感谢任何提示等

Pieter
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



谢谢!

并且有什么方法可以加快速度吗?事实是:在

我的情况下它可能会有所帮助,因为它应该由我们自己的人使用

(Windows窗体应用程序),并提供咨询选项我们的客户

(网络界面)。


但是为什么人们对XML Webservices如此重视?我知道一些

大型软件公司通过WebServices传递所有内容,甚至是本地

Windows窗体应用程序。我对这种技术很怀疑,但现在我更加怀疑使用它......: - /

DraguVaso < PI ********** @ hotmail.com>在消息中写道

新闻:Od ************** @ TK2MSFTNGP10.phx.gbl ...
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... :-/
"DraguVaso" <pi**********@hotmail.com> wrote in message
news:Od**************@TK2MSFTNGP10.phx.gbl...

我是WebServices的新手,我正在做一些测试(用一个小的VB.NET应用程序)来了解一个
WebService之间的性能差异。 />和''normal'' - 获取数据的方式(只是直接连接到SqlDataAdapter到SQL Server)。 WebMethod简单地返回一个DataSet,并且执行与Normal-Method完全相同的操作。

我认为差异很大:
1记录:
WebService:0,03125秒
正常:0,0156秒 - >只有50%的WebService

10条记录:
WebService:0,0468秒正常:0,016秒 - >只有33.33%的WebService

100条记录:
WebService:0,125秒
正常:0,0156秒 - >只有12.5%的WebService

1000条记录:
WebService:1,14秒
正常:0,93秒 - >只有8,22%的WebService

这是怎么来的?网络服务甚至是本地的!所以我想它会花费更多的时间在另一台服务器上......
有没有办法获得更好的性能?为什么使用WebServices如果他们的性能得分如此糟糕?

提前感谢任何提示等

Pieter
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



这篇关于Webservice -'Normal'方式的性能差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆