1

I've got a multithreaded application that calls the same service 200,000+ times per day. Currently it instantiates a new ClientBase auto-generated proxy for each call.

What can I do to boost performance? Instantiate one client and share it? Should I investigate an async client, and if so, can that be shared?

abatishchev
  • 98,240
  • 88
  • 296
  • 433
dcrobbins
  • 525
  • 4
  • 8
  • 200000 calls per day is no big deal. Requesting a proxy for each call is quite inexpensive (WCF internally caches it). Are you sure the bottleneck is on client side? – UserControl Oct 19 '12 at 08:26
  • More Info: the calls are NOT one way. They pass some params and get data back. Also, Basic Authorization is injected into the request header. – dcrobbins Oct 19 '12 at 13:30
  • First of all you need to specify what exactly you want to achieve. Do you want to decrease the app response time? Allow more requests handled per same time frame? Minimize system resource usage? Is your app ASP.NET site, Silverlight app or Windows Forms? What do you mean by "boost performance"? – UserControl Oct 20 '12 at 00:07

1 Answers1

0

What is the nature of your service operations? One-way operations can be easily switched to async with minimum efforts. Especially using TPL (from Async methods family).

Also usually object instantiation is cheap. Just make sure that it doesn't have a heavy constructor. And minimize a number of members to make a type to be constructed as lightweight as possible. This is not a good point for optimization.

You need probably to optimize service calls, data types (de)serialized during them.

abatishchev
  • 98,240
  • 88
  • 296
  • 433