Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. WCF [modified]

WCF [modified]

Scheduled Pinned Locked Moved The Lounge
wcfcsharptestingbeta-testingregex
13 Posts 8 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Steve Westbrook
    wrote on last edited by
    #1

    I just finished testing the performance of WCF against Web Services and was surprised to find that it was actually considerably slower (10-20%) in all of my (admittedly trivial) tests. Does this match up with what other people have found? My understanding was that it was meant to be faster, justifying the absurd amount of configuration you have to go through to use it. //TODO: Sig

    modified on Monday, July 27, 2009 8:15 AM

    realJSOPR R M K R 5 Replies Last reply
    0
    • S Steve Westbrook

      I just finished testing the performance of WCF against Web Services and was surprised to find that it was actually considerably slower (10-20%) in all of my (admittedly trivial) tests. Does this match up with what other people have found? My understanding was that it was meant to be faster, justifying the absurd amount of configuration you have to go through to use it. //TODO: Sig

      modified on Monday, July 27, 2009 8:15 AM

      realJSOPR Offline
      realJSOPR Offline
      realJSOP
      wrote on last edited by
      #2

      Steve Westbrook wrote:

      My understanding was that it was meant to be faster, justifying the absurd amount of configuration you have to go through to use it.

      "Meant to be" is often a term used by Microsoft to which the rest of the world refers to as "wishful thinking". In essence, the intended level of performance was stated as fact by someone at Microsoft talking out of their anal pore (coincidentally located very near the scrotum. Anything coming out of Redmond that ends with the word "framework" indicates a less-than-optimum level of performance due to ungainly and arbitrary wrapping of layers of obfuscatory APIs. You have to marvel at their programmers' expertise. They can rob performance from the simplest of functionality.

      "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
      -----
      "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

      1 Reply Last reply
      0
      • S Steve Westbrook

        I just finished testing the performance of WCF against Web Services and was surprised to find that it was actually considerably slower (10-20%) in all of my (admittedly trivial) tests. Does this match up with what other people have found? My understanding was that it was meant to be faster, justifying the absurd amount of configuration you have to go through to use it. //TODO: Sig

        modified on Monday, July 27, 2009 8:15 AM

        R Offline
        R Offline
        Rama Krishna Vavilala
        wrote on last edited by
        #3

        What exactly did you measure? Call time from client to the server? WCF does lot more processing and is lot more flexible so I would expect it to be slightly slower. But in real world applications where other things such as data storage and network transfer is involved, the slowness of WCF vs ASMX is not at all significant.

        S 1 Reply Last reply
        0
        • R Rama Krishna Vavilala

          What exactly did you measure? Call time from client to the server? WCF does lot more processing and is lot more flexible so I would expect it to be slightly slower. But in real world applications where other things such as data storage and network transfer is involved, the slowness of WCF vs ASMX is not at all significant.

          S Offline
          S Offline
          Steve Westbrook
          wrote on last edited by
          #4

          I was interested in overall performance, so that's what I measured. Specifically, the time it took to return a business object or datatable n times - the full round-trip. I did use BasicHttpBinding for this; maybe I should have used wsHttpBinding or otherwise messed with the settings. Also, I ran these tests over a network, and they hit the database, so they were a real-world evaluation, if only on a limited scale; that was sort of the idea. As for a decrease in speed, it troubles me because, compared to properly configured .NET remoting, Web services are 10-20% slower (although I haven't tested that one myself). Add another 10-20% on top of that and suddenly the difference is anything but negligible. I'm willing to take one hit (maybe) to save some effort, but I'd rather not run at two-thirds the speed of another program with identical functionality. //TODO: Sig

          J R T 3 Replies Last reply
          0
          • S Steve Westbrook

            I was interested in overall performance, so that's what I measured. Specifically, the time it took to return a business object or datatable n times - the full round-trip. I did use BasicHttpBinding for this; maybe I should have used wsHttpBinding or otherwise messed with the settings. Also, I ran these tests over a network, and they hit the database, so they were a real-world evaluation, if only on a limited scale; that was sort of the idea. As for a decrease in speed, it troubles me because, compared to properly configured .NET remoting, Web services are 10-20% slower (although I haven't tested that one myself). Add another 10-20% on top of that and suddenly the difference is anything but negligible. I'm willing to take one hit (maybe) to save some effort, but I'd rather not run at two-thirds the speed of another program with identical functionality. //TODO: Sig

            J Offline
            J Offline
            J4amieC
            wrote on last edited by
            #5

            any Http Binding will be slow as it is, by design, a verbose character-based communication (be it SOAP, XML or any other newfangled protocol). I think the strength in WCF is its configurability, you can develop a service using HttpBinding on your local machine, and deploy it to a Tcp bound binary communication layer (much like remoting in previous frameworks). Think of it is web services, and inter-process communication all wrapped into one (not very?) neat bundle.

            1 Reply Last reply
            0
            • S Steve Westbrook

              I was interested in overall performance, so that's what I measured. Specifically, the time it took to return a business object or datatable n times - the full round-trip. I did use BasicHttpBinding for this; maybe I should have used wsHttpBinding or otherwise messed with the settings. Also, I ran these tests over a network, and they hit the database, so they were a real-world evaluation, if only on a limited scale; that was sort of the idea. As for a decrease in speed, it troubles me because, compared to properly configured .NET remoting, Web services are 10-20% slower (although I haven't tested that one myself). Add another 10-20% on top of that and suddenly the difference is anything but negligible. I'm willing to take one hit (maybe) to save some effort, but I'd rather not run at two-thirds the speed of another program with identical functionality. //TODO: Sig

              R Offline
              R Offline
              Rama Krishna Vavilala
              wrote on last edited by
              #6

              I must say that I am surprised with the results. In my tests the performance difference due to WCF/WebServices was insignificant. Of course, performance matters in the context of your application. If WCF is slow and you are not getting any benefits from WCF then it does not make any sense to migrate your application to WCF.

              1 Reply Last reply
              0
              • S Steve Westbrook

                I just finished testing the performance of WCF against Web Services and was surprised to find that it was actually considerably slower (10-20%) in all of my (admittedly trivial) tests. Does this match up with what other people have found? My understanding was that it was meant to be faster, justifying the absurd amount of configuration you have to go through to use it. //TODO: Sig

                modified on Monday, July 27, 2009 8:15 AM

                M Offline
                M Offline
                martin_hughes
                wrote on last edited by
                #7

                The default config options (ie the ones that are assumed if you don't configure them) are not geared to high performance. One area to look at is serviceThrottling, amongst others. Here's an article I was reading the other day which you might find handy: http://weblogs.asp.net/sweinstein/archive/2009/01/03/creating-high-performance-wcf-services.aspx[^]

                print "http://www.codeproject.com".toURL().text Ain't that Groovy?

                S 1 Reply Last reply
                0
                • M martin_hughes

                  The default config options (ie the ones that are assumed if you don't configure them) are not geared to high performance. One area to look at is serviceThrottling, amongst others. Here's an article I was reading the other day which you might find handy: http://weblogs.asp.net/sweinstein/archive/2009/01/03/creating-high-performance-wcf-services.aspx[^]

                  print "http://www.codeproject.com".toURL().text Ain't that Groovy?

                  S Offline
                  S Offline
                  Steve Westbrook
                  wrote on last edited by
                  #8

                  Nice article, particularly point 2 - I'd heard something about that before but hadn't been able to replicate it. Now if only we used exclusively SQL databases...
                  //TODO: Sig

                  1 Reply Last reply
                  0
                  • S Steve Westbrook

                    I just finished testing the performance of WCF against Web Services and was surprised to find that it was actually considerably slower (10-20%) in all of my (admittedly trivial) tests. Does this match up with what other people have found? My understanding was that it was meant to be faster, justifying the absurd amount of configuration you have to go through to use it. //TODO: Sig

                    modified on Monday, July 27, 2009 8:15 AM

                    K Offline
                    K Offline
                    Kevin McFarlane
                    wrote on last edited by
                    #9

                    Steve Westbrook wrote:

                    My understanding was that it was meant to be faster

                    Hmmm. Here's what is claimed. A Performance Comparison of Windows Communication Foundation (WCF) with Existing Distributed Communication Technologies[^]

                    Steve Westbrook wrote:

                    the absurd amount of configuration you have to go through to use it.

                    Yes, it introduces configuration hell! :)

                    Kevin

                    1 Reply Last reply
                    0
                    • S Steve Westbrook

                      I was interested in overall performance, so that's what I measured. Specifically, the time it took to return a business object or datatable n times - the full round-trip. I did use BasicHttpBinding for this; maybe I should have used wsHttpBinding or otherwise messed with the settings. Also, I ran these tests over a network, and they hit the database, so they were a real-world evaluation, if only on a limited scale; that was sort of the idea. As for a decrease in speed, it troubles me because, compared to properly configured .NET remoting, Web services are 10-20% slower (although I haven't tested that one myself). Add another 10-20% on top of that and suddenly the difference is anything but negligible. I'm willing to take one hit (maybe) to save some effort, but I'd rather not run at two-thirds the speed of another program with identical functionality. //TODO: Sig

                      T Offline
                      T Offline
                      TheGreatAndPowerfulOz
                      wrote on last edited by
                      #10

                      Steve Westbrook wrote:

                      compared to properly configured .NET remoting, Web services are 10-20% slower

                      uh, you're comparing apples and oranges then. .Net Remoting uses binary serialization which has a much smaller payload than HTTP binding. Consequently the times with WCF will be slower. Try using NetDataContract or DataContract binding instead. It's much more comparable to .Net Binary Serialization. Also, remove the DB calls if you want to have comparable timings. The db access will introduce it's own random latency which will confuse the timings.

                      S 1 Reply Last reply
                      0
                      • S Steve Westbrook

                        I just finished testing the performance of WCF against Web Services and was surprised to find that it was actually considerably slower (10-20%) in all of my (admittedly trivial) tests. Does this match up with what other people have found? My understanding was that it was meant to be faster, justifying the absurd amount of configuration you have to go through to use it. //TODO: Sig

                        modified on Monday, July 27, 2009 8:15 AM

                        R Offline
                        R Offline
                        Rutvik Dave
                        wrote on last edited by
                        #11

                        Yes its bit slower, If you use the default config. But once you set/use following, you will see the speed improvements (in my case it was from bit slower to super fast). 1) Use DataContact instead of binary / xml serialization 2) Use serviceThrottling with maxConcurrentSessions=xx 3) Change default value of following to more appropriate value (or set it to max) maxReceivedMessageSize maxBufferPoolSize maxBytesPerRead 4) Use different behavior for different contract, so that you can change the value as per the service requirements. (Don’t use common behavior for all the contracts) 5) Change the value of Send/Receive Timeout, if you are getting frequent timeouts.

                        1 Reply Last reply
                        0
                        • T TheGreatAndPowerfulOz

                          Steve Westbrook wrote:

                          compared to properly configured .NET remoting, Web services are 10-20% slower

                          uh, you're comparing apples and oranges then. .Net Remoting uses binary serialization which has a much smaller payload than HTTP binding. Consequently the times with WCF will be slower. Try using NetDataContract or DataContract binding instead. It's much more comparable to .Net Binary Serialization. Also, remove the DB calls if you want to have comparable timings. The db access will introduce it's own random latency which will confuse the timings.

                          S Offline
                          S Offline
                          Steve Westbrook
                          wrote on last edited by
                          #12

                          In order of appearance: I'm measuring techniques to move data from one place to another. In that context, the comparison seems valid to me - I care how long the user has to wait, not how I write the code. If all you want is something to eat, and you have one very specific criterion for what constitutes good food, comparing apples to oranges is possible. I believe the analogy stands. Presumably you mean the NetDataContract and DataContract attributes. These are not binding types; you appear to be confusing binding with serialization. The performance difference remains when using a business object and a DataContract attribute - that is, when the data is serialized into binary format. HTTPBinding does have a significant overhead; at the moment I'm looking at NetTCPBinding as an alternative. Other than the first call, DB call timing variations are typically negligible, and as with any statistical variation, approach zero with sufficient repetitions. Again, this is an attempt to measure real-world performance, and so I needed to test these methods in something approximating a real-world situation. I could worry about processor and memory availability changing too, but in the end it all comes out in the wash.

                          T 1 Reply Last reply
                          0
                          • S Steve Westbrook

                            In order of appearance: I'm measuring techniques to move data from one place to another. In that context, the comparison seems valid to me - I care how long the user has to wait, not how I write the code. If all you want is something to eat, and you have one very specific criterion for what constitutes good food, comparing apples to oranges is possible. I believe the analogy stands. Presumably you mean the NetDataContract and DataContract attributes. These are not binding types; you appear to be confusing binding with serialization. The performance difference remains when using a business object and a DataContract attribute - that is, when the data is serialized into binary format. HTTPBinding does have a significant overhead; at the moment I'm looking at NetTCPBinding as an alternative. Other than the first call, DB call timing variations are typically negligible, and as with any statistical variation, approach zero with sufficient repetitions. Again, this is an attempt to measure real-world performance, and so I needed to test these methods in something approximating a real-world situation. I could worry about processor and memory availability changing too, but in the end it all comes out in the wash.

                            T Offline
                            T Offline
                            TheGreatAndPowerfulOz
                            wrote on last edited by
                            #13

                            Regardless, the serialization method you use will significantly effect the size of the payload sent over the wire. DataContractSerialization is simiar to XMLSerialization. You stated you were comparing WCF with HTTPBinding to .Net Remoting. The size of the payload will significanly impact the time it takes to transmit over the wire. This has two problems: 1. By default, .Net remoting uses Binary Serialization. Binary Serialization produces much smaller payloads than DataContract Serialization. The NetDataContractSerializer will produce payloads similar in size to BinarySerialization. 2. .Net Remoting is a connection protocol, whereas HTTPBinding is connectionless. Why is this important? Each time you make a method call in WCF/HTTPBinding it will reconnect to the server. In .Net remoting, this is not the case -- the port remains connected. Hence reconnecting for each method call is expensive. Using WCF / net.tcp will eliminate this difference. Unless the call throws an exception, in which case you must close and reconnect. Hence due to these two reasons, when comparing .Net Remoting and WCF / HTTPBinding you can not reasonably expect similar timings.

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups