Home Products Consulting Download Registration Support Events

Home
Up

 

Performance Comparison between SocketPro and Window Communication Framework (WCF)


        UDAParts
        support@udaparts.com
        Updated on 11
/23/2010

 


        

    1.    Introduction

    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.

    3.    Results

    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.

 

  • Tiny rowset (2.5x - 4x)
            Regarding to a tiny rowset (for example, Select * from Production.Culture) with a few records, SocketPro is 2.5 times faster than WCF. If SocketPro is enabled with requests batch, SocketPro could be four times faster than WCF.
            
  • Small rowset (4x - 5x)
            With a small table (e.g. Select * from Production.Product) having less than 1000 records, the speed of SocketPro is typically four faster than WCF. If SocketPro is armed with requests batch, the speed of SocketPro could be five times of WCF easily.
            
  • Regular rowset (6x - 8x)
            If you have to handle a normal size rowset created from the statement Select * from Production.BillOfMaterials, SocketPro is around seven times faster than WCF.
            
  • Large rowset ( 8x - 10x)
            For a large rowset generated from the SQL statement select * from Production.WorkOrder, SocketPro could be easily ten times faster than WCF.
            
  • Simple Requests (2.5x - 12x)
            After executing 10,000 echo requests with both SocketPro and WCF. you will also find that SocketPro is significantly faster than WCF too. Typically, SocketPro is about three times faster than WCF. If SocketPro is used with requests batch, it could be easily ten or more times faster than WCF 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.

   

  • Tiny rowset (2x - 4x)
            Regarding to a tiny rowset (for example, Select * from Production.Culture) with a few records, SocketPro is about three times faster than WCF. If SocketPro is enabled with requests batch, SocketPro could be four times faster than WCF.
            
  • Small rowset (6x - 11x)
            With a small table (e.g. Select * from Production.Product) having less than 1000 records, the speed of SocketPro is typically seven times faster than WCF. If SocketPro is armed with requests batch, the speed of SocketPro could be more than ten times faster than WCF easily.
            
  • Regular rowset (10x - 15x)
            For a normal size rowset created from the statement Select * from Production.BillOfMaterials, SocketPro is easily more than ten times faster than WCF.
            
  • Large rowset ( 11x - 16x)
            In case you have a large rowset generated from the SQL statement select * from Production.WorkOrder, SocketPro could be easily more than ten times faster than WCF.
            
  • Simple Requests (1.5x - 50x)
            After executing 10,000 echo requests, our SocketPro is one and half faster than WCF over 100 Mbps LAN. This test was completed on LAN with a too large latency, which masks the difference in performance. If you use a LAN with small latency or 1000 Mpbs network bandwith, the difference in performance could be much larger. For this testing condition, if our SocketPro is enabled with requests batch, SocketPro could be more than fifty times faster than WCF.

4.    Why is SocketPro so much faster than WCF?

    a.    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.
    b.    SocketPro fully takes advantage of binary transferring data over expensive networks. It doesn't use text format for moving data over network.
    c.    SocketPro uses 100% non-blocking socket communication so that all network devices on one transaction circle works concurrently, but WCF has no way to ensure that all network devices on one transaction circle works at the same time.
    d.    SocketPro enables you to further tune communication performance by setting TCP stack receiving and sending buffers at both client and server sides. If your network is a wide area network like wireless network, DSL modem or phone modem with low bandwidth, you can also turn on the SocketPro built-in online compression feature.

5.    Conclusion

    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