Performance issue

Hello all!
I’ve got a question about performances of my ServiceStack test using xml response format + in-memory cache… I compared my results with northwind cached demo, and these are the results:

Northwind demo:

My server test:

It seems that my test takes 42ms to respond against the 126ms of northwind demo… the amount of xml data transferred is about the same, but my test has an onload time of 2,86s to load the page… this gives a general slowness impression…
I would like to know from what “onload time” depends? There’s some way to reduce it?

The XML Content Type uses Microsoft’s .NET Xml DataContract Serializer. It can be expensive on its first run since it uses code-gen behind the scenes trading startup performance for better runtime performance. Whenever you measure serializer performance you should ignore the first run which doesn’t reflect actual runtime performance.

You wont get any meaningful comparison looking at the cached response times which doesn’t do any work and just returns the pre-serialized bytes on the response stream.

I don’t know what onload means in your graphs or what analyzer you’re using, I’m assuming it means Start Up time.

Most of the other Content Types are going to be faster and smaller than XML, so don’t use XML if you’re after raw performance.

I’ve tried the same tests with json but the results are not too different… the onload time is always pretty hight…
I’m using firebug for firefox, but you can get the same results with the Chrome’s web tools.