How do increase WCF Performance?


  • Hi All,


    How do increase the WCF start-up performance using XMLSerializer.


    thanks in advance.



    Wednesday, April 02, 2008 11:13 AM


All replies

  • Why not consider using DataContractSerializer?  I did not compare the performance between XMLSerializer and DataContractSerializer.  However, DataContractSerializer is the default serializer for WCF and, therefore, I presume that it performs better than the older XMLSerializer.


    Wednesday, April 02, 2008 11:43 AM

    Hi Pyeung !


    Actually i was going to transfer a Large Data through DataSet . By what way It will increase and it use ful ?

    is there any way to use DataContract Serializer ....



    Wednesday, April 02, 2008 12:51 PM

    Hi Sami  Sir!


    Please Refer this URL for XMl Serializer Performance



    Wednesday, April 02, 2008 12:52 PM
  • thanks sasi.


    Will check and update you soon.





    Wednesday, April 02, 2008 1:22 PM

    I tried with the XMLSerializer, but got warning as given below.



    Svcutil.ext /t:xmlserializer "C:\Inetpub\wwwroot\service\sampleservice.dll"



    Generating xml serializer...

    Warning: Cannot generate xmlserializer for assembly file: C:\Inetput\wwwroot\service\sampleservice.dll\

    No service contract in the Assembly has an Operation with xmlSerializerOperation Behaviors.




    thanks in advance




    Wednesday, April 02, 2008 1:29 PM
  • Serialization and deserialization only helps in converting the data format.  I do not think it has real effect on transferring large data because data transmission occupies most of the time. If you are transferring large dataset via Http, you can consider compressing your data by using MTOM (Message Transmission Optimization Mechanism) Encoding (the default is Text Encoding).  If you are using Tcp, your message is defaulted to Binary Message Encoding (which is the most compact built-in format in WCF).

    Thursday, April 03, 2008 1:43 AM

    Hi Pyeung !


     I tried with Gzip compression but it wont increase the  Application performance. it consumes less than 2 seconds compared with dataset . by the way i am using WShttpbiningig with http Protocal but it does n't support to transfer as Stream. Is there Any other way to increase the WCF Srervice performance.





    Thursday, April 03, 2008 5:34 AM
  • WSHttpBinding supports MTOM but does not support streaming.

    Friday, April 04, 2008 1:12 AM
  • When you say performance, what dfo you mean?  Do you mean messages processed per second, total throughput, or some other measure?


    WsHttpBinding doesn't support streaming due to the reliable messaging protocol (WS-RM), which requires that messages are buffered on either end - if you don't need this, then BasicHttpBinding or a custom binding might give you the performance you're looking for.



    Friday, April 04, 2008 11:31 PM
  • I mean total throughput. It takes more time to transmit data from server to client.




    Wednesday, April 09, 2008 11:28 AM
  • Rather than generating the serialization code in runtime, you may use the approach described in the link below.


    For overall performance issues, refer to the link below. You may use performance analyzer to figure out what are the bottlenecks for your application.

    Wednesday, April 09, 2008 5:59 PM