Click here to Skip to main content
12,893,816 members (56,767 online)
Click here to Skip to main content
Add your own
alternative version


2 bookmarked
Posted 7 Jun 2012

WCF Client Performance Using ObjectDataSource

, 7 Jun 2012 Ms-PL
Rate this:
Please Sign up or sign in to vote.
Improving WCF client performance using ObjectDataSource.

WCF Client Performance

So everyone knows that WCF clients incur more overhead than their predecessor proxy clients. The penalty comes from establishing a connection to the WCF service and somewhat depends on the binding you have configured. Some bindings are more expensive than others, but there is more overhead regardless. Also, you know that now you have to be responsible for closing your proxy client. Previously you could just instantiate a proxy instance, call method(s) and let the garbage collector do the rest. A logical and easy way to provide a speedup is to instantiate a client object and save it as a private member variable of your page, usercontrol, etc. This prevents you from having to create/close more than one client.


If you use an ObjectDataSource with a TypeName of a WCF proxy client, then it will be instantiating a WCF client and incurring the same overhead. It is pretty common to find more than one ODS on a page, in fact I have seen pages with a dozen or more. Also, it is common to find multiple ObjectDataSources referencing the same service. So it is quite easy to see a performance gain from making your ODSources use one client instance. How? The ObjectDataSource exposes two critical events that make this speedup possible, and even easy:


This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


About the Author

Software Developer (Senior)
United States United States
No Biography provided

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170424.1 | Last Updated 7 Jun 2012
Article Copyright 2012 by matt-dot-net
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid