Analytics

2011年12月15日 星期四

[WCF,WebService]比較 WCF wsHttpbinding,netTcpBinding vs WebService 速度(Compare WCF wsHttpbinding, netTcpBinding vs WebService speed)


問題
WCF wsHttpbinding,netTcpBinding vs WebService 速度



解決方法
基準:
66萬筆資料塞入弱型別DataSet回傳
結果表示:
Client --> Middle(指令從client端傳入service時的時間,可以說是open connection的時間)
Middle --> Clien(從db取得資料以後,回傳到client所需時間)
WCF wsHttpbinding VS WebService
WCF WebService
ROUND 1 Client --> Middle : 946
Middle --> Client : 270615
Client --> Middle : 968
Middle --> Client : 19831
ROUND 2 Client --> Middle : 835
Middle --> Client : 33100
Client --> Middle : 957
Middle --> Client : 19883
ROUND 3 Client --> Middle : 878
Middle --> Client : 29743
Client --> Middle : 955
Middle --> Client : 19832
ROUND 4 Client --> Middle : 778
Middle --> Client : 289066
Client --> Middle : 953
Middle --> Client : 19690
ROUND 5 Client --> Middle : 694
Middle --> Client : 320080
Client --> Middle : 954
Middle --> Client : 19868
ROUND 6 Client --> Middle : 963
Middle --> Client : 28066
Client --> Middle : 960
Middle --> Client : 19713
AVG Client --> Middle : 867
Middle --> Client : 34653
Client --> Middle : 957
Middle --> Client : 19802

WCF netTCPbinding VS WebService
WCF WebService
ROUND 1 Client --> Middle : 841
Middle --> Client : 19025
Client --> Middle : 968
Middle --> Client : 19831
ROUND 2 Client --> Middle : 497
Middle --> Client : 19310
Client --> Middle : 957
Middle --> Client : 19883
ROUND 3 Client --> Middle : 820
Middle --> Client : 18943
Client --> Middle : 955
Middle --> Client : 19832
ROUND 4 Client --> Middle : 683
Middle --> Client : 18966
Client --> Middle : 953
Middle --> Client : 19690
ROUND 5 Client --> Middle : 371
Middle --> Client : 19080
Client --> Middle : 954
Middle --> Client : 19868
ROUND 6 Client --> Middle : 207
Middle --> Client : 18987
Client --> Middle : 960
Middle --> Client : 19713
AVG Client --> Middle : 569
Middle --> Client : 19051
Client --> Middle : 957
Middle --> Client : 19802
結果表示:
同一個基準點上,WCF的執行效能劣於WEB SERVICE,但若改用netTCPbinding的話,則速度不相上下!
但由於netTCPbinding只適用於.net與.net架構上使用,並不像WEB SERVICE一樣的使用XML進行溝通,因此架構使用上需注意
官方說明:
http://msdn.microsoft.com/zh-tw/library/bb310550%28en-us%29.aspx

沒有留言:

熱門文章