Performance Comparison between SocketPro and Window Communication Framework (WCF)
Everyone knows that software performance is extremely importance with real enterprise applications. No software engineer likes to create a sluggish software. We have created a socket-based framework based on asynchrony, requests batch and parallel computation to accelerate data movement between two computers. One of its greatest advantages is that the framework delivers extremely high performance and scalability in comparison with other well known frameworks such as DCOM, Corba, Java RMI, dotNet Remoting, WCF and SOAP/XML web service. This article, along with source code, demonstrates the performance improvement of SocketPro framework over the latest Microsoft technology Window Communication Foundation (WCF). Hopefully, it catches your attention.
2. Performance comparison source code and experiment conditions
Source codes for C++, C# and VB.NET performance investigation projects are located at the directory ..\samples\performance, after installing SocketPro package. Although this srticle does not list the performance data of .NET remoting any more, SocketPro comes with sample applications located at the same directory for .NET remoting. You can use the sample applications for your own study.
A DataSet or DataTable instance is set with BinaryFormat for WCF in .NET 2. Additionally, security of WCF is disabled under all testing cases. Note that the used database is the sample database AdventureWorks for SQL server 2008 express. All of other experiment conditions are shown on the pictures.
Note that all of numbers listed on the below pictures are the real time (in millisecond) measured from executing requests with 10000 times for the request Echo and 100 times for SQL statements. Also, the pictures list the number of rows and the size of recordset in mega bytes.
Overall, SocketPro is significantly faster than WCF under all cases. We have never met any test that WCF is faster than our SocketPro for over six years. Typically, SocketPro is four times faster than WCF. Under many cases, SocketPro could be more than twenty times faster than WCF as you will see in the coming sections.
a. Performance comparison between SocketPro and WCF for cross-application communication on the same machine
The test results and conditions are listed in the below picture for cross application communication on one local host (same machine). Note that WCF is set with netPipe binding, which is the fastest binding available for cross application communication on the same machine.
b. Performance comparison between SocketPro and WCF for cross-machine communication with TCP/IP protocol
The performance data listed on the below table was obtained with a local area network (LAN) having bandwidth 100 Mpbs. The latency between client and server is about 0.6 millisecond. Both SocketPro and WCF use TCP/IP protocol for communication between client and server.
4. Why is SocketPro so much faster than WCF?
SocketPro can batch any number of requests at client and returned results at
server so that network efficiency is 100% and no bandwidth is wasted. This is
very different from WCF.
SocketPro is written from asynchrony, batching and parallel computation. Its design is dramatically different from frameworks like SOAP/XML web service, dotNet remoting, WCF, DCOM, Corba and Java RMI. It is more closer to non-blocking socket but it certainly makes socket programming much easier. This article is written specifically for demonstration of SocketPro performance with comparison to MS WCF framework. Although we didn't compare it with other common frameworks, it is guaranteed that all of other frameworks run like snail too in speed, in comparison to SocketPro.
At last, SocketPro not only offers the best performance and scalability among all of common frameworks but also has a lot of features. Many of them are unique and can be found ONLY in SocketPro. For a list of features, click here.
6. Further readings