AngryHacker
AngryHacker

Reputation: 61646

What is the holdup on the first WCF call via the serviceProxy?

There are a lot of similar questions, but they all deal with server-side slowness - this is all about client-side issues.

1st call takes 900ms. 2nd call takes 20 ms.

I narrowed the slowness on the first call to serviceProxy.Method(). Fiddler reports that the actual time on the wire for the 1st call is 16 ms. Since the 2nd call is massively faster, I am forced to conclude the problem occurs with some WCF client-side instantiation code that fires when the first method call takes place.

Facts:

Any ideas why the slowdown occurs on the 1st post?

Upvotes: 4

Views: 689

Answers (1)

bryanmac
bryanmac

Reputation: 39306

A common server slowness on start is IIS app pool spin up but in your question you stated that even though the first request was 900 ms, only 16 ms was spent on the server request according to fiddler. If that's true, it suggests something is going on client side.

One possibility is that some client apps that serialize objects generate and compile serialization code for those data types at runtime, which can result in slow start-up performance

http://msdn.microsoft.com/en-us/library/aa751883.aspx

http://msdn.microsoft.com/en-us/library/ms733901.aspx

I'm not familiar with protobuffs but compiling serialization code is trade off which makes the first call significantly slower but makes subsequent calls faster.

Not sure if that's your initial cost but it's a possibility.

Upvotes: 2

Related Questions