Search
Close this search box.

WCF vs. Remoting (with DataSet)- performance comparison

In the last blog I wrote about Windows Communication Foundation performance comparison. The document available here: A Performance Comparison of Windows Communication Foundation (WCF) with Existing Distributed Communication Technologies. I am mainly interested in the comparison of WCF and .NET Remoting. I decided to perform my own research on that topic. Here is what I tested:

  1. SingleCall service – the simplest .NET Remoting service type
  2. Data Transfer Object is DataSet – I believe it is the common medium of sending data
  3. Client and Server are both placed on a single machine
  4. TCP channel – this one allows to communicate two machines with .NET on both sides

Let me describe the client and server applications:

Server

  • The service in general:
    – contains one method that takes one argument and returns DataSet (the DataSet contains as many rows as method argument says)
    – DataSet contains 4 columns – ID (long), Name (string), Description (string) and CreatedOn (DateTime)
  • The .Net Remoting version of the service:
    – it’s a wellknown server activated object with SingleCall activation mode
    – the channel is TCP with binary serialization
  • The WCF version of the service:
    – it uses netTcpBinding

Client

  • Invokes each of the service (WCF and Remoting) 100 times on a single thread (sequential invocation in a loop)
  • Passes to the service number of rows to generate in the DataSet (1, 100 and 200)
  • I measured creation of the service proxy, method invocation and proxy close (with WCF service)

Performance results of the services

I tested four ways of the DataSet serialization settings:

  1. Binary serialization; Schema not included in the DataSet
  2. Xml serialization; Schema not included in the DataSet
  3. Binary serialization; Schema included in the DataSet
  4. Xml serialization; Schema included in the DataSet

Here are sample results displayed on charts:

Explantion: The charts show time (in miliseconds) of method invocation so – the lower the better.

Explantion: The charts show time (in miliseconds) of method invocation so – the lower the better.

I chose here the fastest and the slowest of my tests: binary + no schema and xml + schema. As you can see in each of the cases the Remoting service is the fastest one (probably because the DataSet native serialization is better to the one provided with WCF).

Conclusion

Sending DataSet with .NET Remoting is faster (in any of cases I tested) than sending it with WCF. Maybe there is some other way to improve the WCF in case of sending DatSet but I haven’t found it yet. I’ll post the test project somewhere (maybe on codeproject) so it could be examined.

Print | posted on Thursday, April 12, 2007 7:02 PM |

This article is part of the GWB Archives. Original Author:  Marcin Celej

Related Posts