Welcome to MSDN Blogs Sign in | Join | Help

Welcome to The Metaverse

Navigating the service-oriented, identity aware metaverse

News

  • Disclaimer:
    The content of this blog are my own personal opinions and do not necessarily represent Microsoft's position, commitments or strategy. In addition, my thoughts and opinions often change, and as a weblog is intended to provide a semi-permanent point in time snapshot you should not consider out of date posts to reflect my current thoughts and opinions.




    Add to Technorati Favorites
Whaddya mean Web Services are too slow?

Before I start, I would like to make it clear that, yes, you might be one of the 10-20% of developers implementing sophisticated control systems, writing code that demands the absolute minimun call latency for any given operation, or any number of hard-core scenarios where the time taken to serialize a request for work to be done absolutely must be kept to the absolute minimum. There indeed many scenarios where serializing a request for work to be done into an XML payload, wrapping that with a SOAP envelope, delivering the message via HTTP and then unpacking the envelope and the payload at the recipient, may, just may be too slow. 

But what about the 80% case? I pose the question - are Web Services REALLY too slow for you?

Consider any given operation within a system that you work upon. For any method/action on a component/service that is invoked across a process or machine boundary, what percentage of the time taken to execute the method/action vs. the amount of time taken to serialize the call and the response? If the time taken to execute is significantly higher percentage of the overall call, then it rarely matters what transport you're using. It's generally only when the cost of transport becomes significant that it becomes a concern.

I would like to point out that anyone who has executed "benchmarks" against code such as the following ...

[WebMethod]
class HelloWorld
{
    [WebMethod]
    string SayHello(string name)
    {
        return "Hello, " + name;
    }
}

... should be ashamed of themselves!!! This tests absolutely nothing other than how fast the call can be serialized. The instant you plug anything into this method such as, for example, reading or writing to or from a database or file on disk, talking to anything else across the network, performing any worthwhile calculation, you'll see an entirely different performance characteristic - one which is much more realistic if nothing else.

The occasions where you start to see the impact of serializing SOAP/XML are typically when you're serializing considerable amounts of data. This is illustrated nicely in the ASMX/ES/Remoting performance whitepaper I published a few months back.

So, before just dismissing Web Services as being too slow, run some tests to see if Web Services could in fact handle the volumes of data and result in call latencies that are within your tolerance ranges - you might be surprised and start to enjoy the benefits of these liberating technologies.

Posted: Monday, December 05, 2005 1:26 PM by RichTurner666

Comments

Jeff Parker said:

I agree, web services are not slow. I do not know what people are expecting or what they are doing wrong. I suspect people that say web services are too slow are the same people that do Select * From SomeTable as a sql query. I have been running web services since the release of 1.0 framework and never a bit of trouble with the web service functionality. Now I have had some performance problems but that was from the database on the back end, a direct query against the database had same perf issues, which was also the first place I went to when someone complained about performance.
# December 6, 2005 9:19 AM

kruch said:

On the other hand, I've once profiled such benchmark on .NET 1.1, and I saw "double saw-tooth pattern" (as CLR profiler doc speaks of it), aka "midlife crisis" ((c) rico mariani) - definitely nothing to be proud of, too.
# December 7, 2005 6:57 AM

RichTurner666 said:

Was the sawtooth that you describe CPU cycles, memory, threads, or what? Benchmarks are like any other forms of statistics ... they can be engineered to show whatever you like. Remember all the hullaballoo about graphics cards manufacturers specifically tweaking their drivers to make their magazine review benchmarks look good? (I know this happened because (in my life prior to joining Microsoft) I wrote a tool to help a graphics card company profile their GDI calls in order to optimize their benchmark results).

The proof, as always, is in the tasting ... only by evaluating one of YOUR real-life scenarios will you ever be able to tell if your systems will benefit from one technology or approach over any other.

Benchmarks provide a guideline and an indicator ... nothing else.
# December 7, 2005 1:06 PM

Ruurd Boeke said:

Using webservices implies using xml. That means that your nice object graphs have to be transformed to a xml-message and therein lies the performance loss for me.

So, that's nothing against webservices, more against xml ;-)
# December 29, 2005 4:23 AM

Erics Blog said:

# May 21, 2006 12:49 PM

Erics Blog said:

A month ago I met some Swedish colleges that works for different companies and they all seemed to complain...
# July 26, 2006 3:41 PM

Welcome to The Metaverse said:

I received an email from a long-time follower of my blog that I thought might serve to spark a little

# May 10, 2007 8:23 PM
Anonymous comments are disabled
Page view tracker