Fastest WCF Binding for Silverlight 4

I am working on a project in which a Silverlight 4 client calls a WCF web service that returns a large amount of data. Some profiling has shown that

  • the actual execution of the webservice method takes less than one second (calls another server / generates a very large data set / etc., it is already quite optimized)

  • data transfer depends on the network, but, as a rule, is not a problem - it can receive everything that it needs.

  • the time between the client receives an http response (I see it as completed in Fiddler) and the Completed event raised in the Silverlight client: ~ 15 seconds (there is no difference between IE / firefox / chrome)

I believe the 15 second delay is pretty much spent on deserialization.

My binding uses HttpTransport and BinaryMessageEncoding , with gzip compression on top of it. Gzip compression does not seem to affect performance: the difference between the lack of compression and the maximum compression level is virtually nonexistent. The http response is ~ 15 Mb without compression and ~ 400 kb is compressed (a lot of overhead even with binary XML!)

Note: the web service is completely ad hoc, I am not interested in interoperability and complete freedom of protocol choice.

The obvious solution would be to transfer less data, but introducing swapping will require significant architectural changes that are not currently in progress. Reducing the data set is also quite difficult, because the solution is completely customizable by the end user, and, as you know, users do not always know what they are doing and create huge queries.

I stayed with the wcf binding: this project started with SL 2 and developed through SL 3 and SL 4, so maybe I am missing some faster binding introduced in Silverlight 4. Is there an even faster encoder (or binding ) that I can use to avoid the deserialization bottleneck on the client?

+4
source share
1 answer

How about "cheating" (improving only improved performance)?

Return a small subset of the first call data, then expand the background process to retrieve everything you need. If the data you display is read-only, this may help.

Edit: look at priority binding ... It allows you to associate multiple data sources with a grid. If the slow connection returns later, silverlight will automatically link the new data source ...

+2
source

All Articles